Commit b5f0a34d authored by Kai Willadsen's avatar Kai Willadsen

vc: Update bzr and hg for new-style add() command

parent 391bff31
......@@ -121,9 +121,6 @@ class Vc(object):
self._tree_cache = {}
self._tree_meta_cache = {}
def add_command(self):
raise NotImplementedError()
def remove_command(self, force=0):
raise NotImplementedError()
......
......@@ -88,8 +88,10 @@ class Vc(_vc.Vc):
''.join(state_2_map.keys()),
''.join(state_3_map.keys()),)
def add_command(self):
return [self.CMD] + self.CMDARGS + ["add"]
def add(self, runner, files):
fullcmd = [self.CMD] + self.CMDARGS
command = [fullcmd, 'add']
runner(command, files, refresh=True, working_dir=self.root)
def commit(self, runner, files, message):
fullcmd = [self.CMD] + self.CMDARGS
......
......@@ -55,8 +55,9 @@ class Vc(_vc.Vc):
command = [self.CMD, 'pull', '-u']
runner(command, [], refresh=True, working_dir=self.root)
def add_command(self):
return [self.CMD, "add"]
def add(self, runner, files):
command = [self.CMD, 'add']
runner(command, files, refresh=True, working_dir=self.root)
def remove_command(self, force=0):
return [self.CMD, "rm"]
......
......@@ -158,7 +158,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
"VcCommit": ("commit", (lambda *args, **kwargs: None, [], "")),
"VcUpdate": ("update", (lambda *args, **kwargs: None, )),
"VcPush": ("push", (lambda *args, **kwargs: None, )),
"VcAdd": ("add_command", ()),
"VcAdd": ("add", (lambda *args, **kwargs: None, [])),
"VcResolved": ("resolve", (lambda *args, **kwargs: None, [])),
"VcRemove": ("remove_command", ()),
"VcRevert": ("revert_command", ()),
......@@ -703,10 +703,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self._command, self._get_selected_files(), commit_msg)
def on_button_add_clicked(self, obj):
try:
self.vc.add(self._command, self._get_selected_files())
except NotImplementedError:
self._command_on_selected(self.vc.add_command())
self.vc.add(self._command, self._get_selected_files())
def on_button_remove_clicked(self, obj):
selected = 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