transpant and keywords together
blacktrash at gmx.net
Tue Dec 22 14:43:36 CST 2009
* Berkes Adam on Tuesday, December 22, 2009 at 19:03:27 +0100
> It is 100% reproducable, I've tried a small scenario:
The following patch fixes it for me. Would you mind trying it?
# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1261514387 0
# Node ID eb7b5d262866780cf0b958ec3b3e6f11f802b94d
# Parent f76984a27b3dfdfda17ef93683a3cb9a04e2dc43
keyword: always enforce diff in restricted mode during transplant
Expanded keyword was read into diff whith transplant -b otherwise.
Thanks to Adam Berkes for providing an example case.
diff --git a/hgext/keyword.py b/hgext/keyword.py
@@ -523,9 +523,11 @@
'''Monkeypatch patch.diff to avoid expansion except when
comparing against working dir.'''
- if node2 is not None:
+ # force restricted mode when transplanting
+ transplant = kwtools['hgcmd'] == 'transplant'
+ if node2 is not None and not transplant:
kwt.match = util.never
- elif node1 is not None and node1 != repo['.'].node():
+ elif node1 is not None and node1 != repo['.'].node() or transplant:
kwt.restrict = True
return orig(repo, node1, node2, match, changes, opts)
More information about the Mercurial-devel