# HG changeset patch # User FUJIWARA Katsunori # Date 2014-06-05 07:47:14 # Node ID dd5ca1a3210917c9f4b0b050d496f42ef1191ccb # Parent 65dd65c645ede2971f271cfe984276f3a470a270 keyword: suppress keyword expansion while 'hg graft' for internal merge Before this patch, 'hg graft' may cause unexpected conflict, if 'hg graft'-ed changes are located near lines in which keywords are embedded, because keywords are substituted with other strings in the working directory. This patch suppresses keyword expansion while 'hg graft' for internal merge by adding 'graft' to 'restricted' command list like 'merge'. diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -103,7 +103,7 @@ nokwcommands = ('add addremove annotate # hg commands that trigger expansion only when writing to working dir, # not when reading filelog, and unexpand when reading from working dir restricted = ('merge kwexpand kwshrink record qrecord resolve transplant' - ' unshelve rebase') + ' unshelve rebase graft') # names of extensions using dorecord recordextensions = 'record' diff --git a/tests/test-keyword.t b/tests/test-keyword.t --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -1243,4 +1243,19 @@ Test restricted mode with rebase $Xinfo$ +xxxx +Test restricted mode with graft + + $ hg graft -q 10 + $ hg diff -r 9 -r 13 a + diff -r 800511b3a22d -r 01a68de1003a a + --- a/a Thu Jan 01 00:00:00 1970 +0000 + +++ b/a Thu Jan 01 00:00:00 1970 +0000 + @@ -1,4 +1,6 @@ + +foobranch + expand $Id$ + do not process $Id: + xxx $ + $Xinfo$ + +xxxx + $ cd ..