[meld] Fix git file comparison with mnemonic prefixes (closes bgo#663050)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Fix git file comparison with mnemonic prefixes (closes bgo#663050)
- Date: Tue, 15 Nov 2011 20:00:46 +0000 (UTC)
commit d3530fa9c90247148c05d01e94f4bc763c37f3b4
Author: Aaron Schrab <aaron schrab gmail com>
Date: Wed Nov 16 05:52:54 2011 +1000
Fix git file comparison with mnemonic prefixes (closes bgo#663050)
If the git config setting diff.mnemonicprefix is set, that causes git
diff to use prefixes that indicate what is being compared rather than
always using "a" and "b". For the way that meld invokes git diff, the
prefixes will always be "c" for commit (HEAD) and and "w" for the work
tree. This confuses the patch parser and prevents the modified files
from being copied to the temporary directory, which then results in
patch failing to reverse the changes.
This patch fixes this by modifying the regular expression used to find
index entries in the patch to accept "c" and "w" as prefixes as well as
"a" and "b".
meld/vc/git.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/vc/git.py b/meld/vc/git.py
index 69dc5f3..d45d362 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -37,7 +37,7 @@ class Vc(_vc.CachedVc):
NAME = "Git"
VC_DIR = ".git"
PATCH_STRIP_NUM = 1
- PATCH_INDEX_RE = "^diff --git a/(.*) b/.*$"
+ PATCH_INDEX_RE = "^diff --git [ac]/(.*) [bw]/.*$"
state_map = {
"X": _vc.STATE_NONE, # Unknown
"A": _vc.STATE_NEW, # New
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]