[meld/VersionControlRework: 78/123] vc: Update other version control systems to new commit API



commit 555418ab82077637f9b06abebb9dcc4708122cbc
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Apr 1 09:05:07 2015 +1000

    vc: Update other version control systems to new commit API
    
    Apparently nothing except Git wants to support files arguments for the
    commit command. This seems very wrong, but I'm not changing it here and
    now.

 meld/vc/bzr.py       |    8 +++++---
 meld/vc/mercurial.py |    5 +++--
 meld/vc/svn.py       |    5 +++--
 3 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/meld/vc/bzr.py b/meld/vc/bzr.py
index 073f65a..bc745bb 100644
--- a/meld/vc/bzr.py
+++ b/meld/vc/bzr.py
@@ -88,12 +88,14 @@ class Vc(_vc.Vc):
                                             ''.join(state_2_map.keys()),
                                             ''.join(state_3_map.keys()),)
 
-    def commit_command(self, message):
-        return [self.CMD] + self.CMDARGS + ["commit", "-m", message]
-
     def add_command(self):
         return [self.CMD] + self.CMDARGS + ["add"]
 
+    def commit(self, runner, files, message):
+        fullcmd = [self.CMD] + self.CMDARGS
+        command = [fullcmd, 'commit', '-m', message]
+        runner(command, [], refresh=True, working_dir=self.root)
+
     def revert(self, runner, files):
         runner(
             [self.CMD] + self.CMDARGS + ["revert"] + files, [], refresh=True,
diff --git a/meld/vc/mercurial.py b/meld/vc/mercurial.py
index 26c66cb..3d43738 100644
--- a/meld/vc/mercurial.py
+++ b/meld/vc/mercurial.py
@@ -47,8 +47,9 @@ class Vc(_vc.Vc):
         "R": _vc.STATE_REMOVED,
     }
 
-    def commit_command(self, message):
-        return [self.CMD, "commit", "-m", message]
+    def commit(self, runner, files, message):
+        command = [self.CMD, 'commit', '-m', message]
+        runner(command, [], refresh=True, working_dir=self.root)
 
     def update_command(self):
         return [self.CMD, "update"]
diff --git a/meld/vc/svn.py b/meld/vc/svn.py
index e49f0ee..b5bd409 100644
--- a/meld/vc/svn.py
+++ b/meld/vc/svn.py
@@ -52,8 +52,9 @@ class Vc(_vc.Vc):
         "conflicted": _vc.STATE_CONFLICT,
     }
 
-    def commit_command(self, message):
-        return [self.CMD,"commit","-m",message]
+    def commit(self, runner, files, message):
+        command = [self.CMD, 'commit', '-m', message]
+        runner(command, [], refresh=True, working_dir=self.root)
 
     def update_command(self):
         return [self.CMD,"update"]


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