Commit 8eb50ddd authored by Kai Willadsen's avatar Kai Willadsen

vc: Update svn and hg for new-style revert() command, remove old one

parent 6472fc49
......@@ -121,11 +121,6 @@ class Vc(object):
self._tree_cache = {}
self._tree_meta_cache = {}
def revert_command(self):
raise NotImplementedError()
# Prototyping VC interface version 2
def get_files_to_commit(self, paths):
raise NotImplementedError()
......
......@@ -63,8 +63,9 @@ class Vc(_vc.Vc):
command = [self.CMD, 'rm']
runner(command, files, refresh=True, working_dir=self.root)
def revert_command(self):
return [self.CMD, "revert"]
def revert(self, runner, files):
command = [self.CMD, 'revert']
runner(command, files, refresh=True, working_dir=self.root)
@classmethod
def valid_repo(cls, path):
......
......@@ -64,8 +64,9 @@ class Vc(_vc.Vc):
command = [self.CMD, 'rm', '--force']
runner(command, files, refresh=True, working_dir=self.root)
def revert_command(self):
return [self.CMD,"revert"]
def revert(self, runner, files):
command = [self.CMD, 'revert']
runner(command, files, refresh=True, working_dir=self.root)
def resolve(self, runner, files):
command = [self.CMD, 'resolve', '--accept=working']
......
......@@ -161,7 +161,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
"VcAdd": ("add", (lambda *args, **kwargs: None, [])),
"VcRemove": ("remove", (lambda *args, **kwargs: None, [])),
"VcResolved": ("resolve", (lambda *args, **kwargs: None, [])),
"VcRevert": ("revert_command", ()),
"VcRevert": ("revert", (lambda *args, **kwargs: None, [])),
}
# Map for inter-tab command() calls
......@@ -731,10 +731,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.vc.resolve(self._command, self._get_selected_files())
def on_button_revert_clicked(self, obj):
try:
self.vc.revert(self._command, self._get_selected_files())
except NotImplementedError:
self._command_on_selected(self.vc.revert_command())
self.vc.revert(self._command, self._get_selected_files())
def on_button_delete_clicked(self, obj):
files = self._get_selected_files()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment