[meld/VersionControlRework: 83/123] vc: Update svn and hg for new-style add() command, remove old one



commit 6472fc499f044fd0005c5da03ba166af717ea6dd
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Apr 11 07:56:27 2015 +1000

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

 meld/vc/_vc.py       |    3 ---
 meld/vc/mercurial.py |    5 +++--
 meld/vc/svn.py       |    6 ++++--
 meld/vcview.py       |    7 ++-----
 4 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index a099ce2..6216a83 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -121,9 +121,6 @@ class Vc(object):
         self._tree_cache = {}
         self._tree_meta_cache = {}
 
-    def remove_command(self, force=0):
-        raise NotImplementedError()
-
     def revert_command(self):
         raise NotImplementedError()
 
diff --git a/meld/vc/mercurial.py b/meld/vc/mercurial.py
index 2f79a94..2070c7f 100644
--- a/meld/vc/mercurial.py
+++ b/meld/vc/mercurial.py
@@ -59,8 +59,9 @@ class Vc(_vc.Vc):
         command = [self.CMD, 'add']
         runner(command, files, refresh=True, working_dir=self.root)
 
-    def remove_command(self, force=0):
-        return [self.CMD, "rm"]
+    def remove(self, runner, files):
+        command = [self.CMD, 'rm']
+        runner(command, files, refresh=True, working_dir=self.root)
 
     def revert_command(self):
         return [self.CMD, "revert"]
diff --git a/meld/vc/svn.py b/meld/vc/svn.py
index 2454e7c..a4094bf 100644
--- a/meld/vc/svn.py
+++ b/meld/vc/svn.py
@@ -60,8 +60,10 @@ class Vc(_vc.Vc):
         command = [self.CMD, 'update']
         runner(command, [], refresh=True, working_dir=self.root)
 
-    def remove_command(self, force=0):
-        return [self.CMD,"rm","--force"]
+    def remove(self, runner, files):
+        command = [self.CMD, 'rm', '--force']
+        runner(command, files, refresh=True, working_dir=self.root)
+
     def revert_command(self):
         return [self.CMD,"revert"]
 
diff --git a/meld/vcview.py b/meld/vcview.py
index c22af46..dda6343 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -159,8 +159,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
         "VcUpdate": ("update", (lambda *args, **kwargs: None, )),
         "VcPush": ("push", (lambda *args, **kwargs: None, )),
         "VcAdd": ("add", (lambda *args, **kwargs: None, [])),
+        "VcRemove": ("remove", (lambda *args, **kwargs: None, [])),
         "VcResolved": ("resolve", (lambda *args, **kwargs: None, [])),
-        "VcRemove": ("remove_command", ()),
         "VcRevert": ("revert_command", ()),
     }
 
@@ -725,10 +725,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
             if response != Gtk.ResponseType.OK:
                 return
 
-        try:
-            self.vc.remove(self._command, selected)
-        except NotImplementedError:
-            self._command_on_selected(self.vc.remove_command())
+        self.vc.remove(self._command, selected)
 
     def on_button_resolved_clicked(self, obj):
         self.vc.resolve(self._command, self._get_selected_files())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]