meld r1342 - trunk/vc



Author: vincele
Date: Sat Apr 11 22:52:51 2009
New Revision: 1342
URL: http://svn.gnome.org/viewvc/meld?rev=1342&view=rev

Log:
Fix Mercurial "diff --git" mode

gnome bug: http://bugzilla.gnome.org/show_bug.cgi?id=447582
debian bug: http://bugs.debian.org/428843

Mercurial can be configuresd to output its diffs in "git" mode,
cope with that gracefully.


Modified:
   trunk/vc/mercurial.py

Modified: trunk/vc/mercurial.py
==============================================================================
--- trunk/vc/mercurial.py	(original)
+++ trunk/vc/mercurial.py	Sat Apr 11 22:52:51 2009
@@ -31,12 +31,17 @@
     NAME = "Mercurial"
     VC_DIR = ".hg"
     PATCH_STRIP_NUM = 1
-    PATCH_INDEX_RE = "^diff -r \w+ (.*)$"
+    # Mercurial diffs can be run in "git" mode
+    PATCH_INDEX_RE = "^diff (?:-r \w+ |--git a/.* b/)(.*)$"
+    DIFF_GIT_MODE = False
 
     def commit_command(self, message):
         return [self.CMD,"commit","-m",message]
     def diff_command(self):
-        return [self.CMD,"diff"]
+        ret = [self.CMD,"diff"]
+        if self.DIFF_GIT_MODE:
+            ret.append("--git")
+        return ret
     def update_command(self):
         return [self.CMD,"update"]
     def add_command(self, binary=0):



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