Commit 86646ded authored by Vincent Legoll's avatar Vincent Legoll

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.

svn path=/trunk/; revision=1342
parent 8e45a1db
......@@ -31,12 +31,17 @@ class Vc(_vc.Vc):
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):
......
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