Commit 391bff31 authored by Kai Willadsen's avatar Kai Willadsen

vc: Make update() not take files, and update svn and hg to new API

parent 81f254cc
......@@ -121,9 +121,6 @@ class Vc(object):
self._tree_cache = {}
self._tree_meta_cache = {}
def update_command(self):
raise NotImplementedError()
def add_command(self):
raise NotImplementedError()
......@@ -144,7 +141,7 @@ class Vc(object):
def commit(self, runner, files, message):
raise NotImplementedError()
def update(self, runner, files):
def update(self, runner):
raise NotImplementedError()
def push(self, runner):
......
......@@ -106,7 +106,7 @@ class Vc(_vc.Vc):
[self.CMD] + self.CMDARGS + ["push"], [], refresh=True,
working_dir=self.root)
def update(self, runner, files):
def update(self, runner):
# TODO: Handle checkouts/bound branches by calling
# update instead of pull. For now we've replicated existing
# functionality, as update will not work for unbound branches.
......
......@@ -179,7 +179,7 @@ class Vc(_vc.Vc):
command = [self.CMD, 'commit', '-m', message]
runner(command, files, refresh=True, working_dir=self.root)
def update(self, runner, files):
def update(self, runner):
command = [self.CMD, 'pull']
runner(command, [], refresh=True, working_dir=self.root)
......
......@@ -51,8 +51,9 @@ class Vc(_vc.Vc):
command = [self.CMD, 'commit', '-m', message]
runner(command, [], refresh=True, working_dir=self.root)
def update_command(self):
return [self.CMD, "update"]
def update(self, runner):
command = [self.CMD, 'pull', '-u']
runner(command, [], refresh=True, working_dir=self.root)
def add_command(self):
return [self.CMD, "add"]
......
......@@ -56,8 +56,9 @@ class Vc(_vc.Vc):
command = [self.CMD, 'commit', '-m', message]
runner(command, [], refresh=True, working_dir=self.root)
def update_command(self):
return [self.CMD,"update"]
def update(self, runner):
command = [self.CMD, 'update']
runner(command, [], refresh=True, working_dir=self.root)
def remove_command(self, force=0):
return [self.CMD,"rm","--force"]
......
......@@ -156,7 +156,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
# Map action names to VC commands and required arguments list
action_vc_cmds_map = {
"VcCommit": ("commit", (lambda *args, **kwargs: None, [], "")),
"VcUpdate": ("update_command", ()),
"VcUpdate": ("update", (lambda *args, **kwargs: None, )),
"VcPush": ("push", (lambda *args, **kwargs: None, )),
"VcAdd": ("add_command", ()),
"VcResolved": ("resolve", (lambda *args, **kwargs: None, [])),
......@@ -689,10 +689,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self._command(command, files, refresh)
def on_button_update_clicked(self, obj):
try:
self.vc.update(self._command, self._get_selected_files())
except NotImplementedError:
self._command_on_selected(self.vc.update_command())
self.vc.update(self._command)
def on_button_push_clicked(self, obj):
response = vcdialogs.PushDialog(self).run()
......
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