changeset 21707:e22cfd1ae97c stable

keyword: suppress keyword expansion while 'hg histedit' for internal merge Before this patch, 'hg histedit' may cause unexpected conflict, if 'hg histedit'-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 histedit' for internal merge by adding 'histedit' to 'restricted' command list like 'merge'. Test in this patch just swaps order of revision #13 and #14: this is enough to cause internal merge.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 05 Jun 2014 16:47:14 +0900
parents 5c64c338fa9f
children 2668a78df8ba
files hgext/keyword.py tests/test-keyword.t
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Thu Jun 05 16:47:14 2014 +0900
+++ b/hgext/keyword.py	Thu Jun 05 16:47:14 2014 +0900
@@ -103,7 +103,7 @@
 # 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 graft backout')
+              ' unshelve rebase graft backout histedit')
 
 # names of extensions using dorecord
 recordextensions = 'record'
--- a/tests/test-keyword.t	Thu Jun 05 16:47:14 2014 +0900
+++ b/tests/test-keyword.t	Thu Jun 05 16:47:14 2014 +0900
@@ -1271,4 +1271,17 @@
    $Xinfo$
   -xxxx
 
+Test restricted mode with histedit
+
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > histedit =
+  > EOF
+
+  $ hg commit -m 'backout #11'
+  $ hg histedit -q --command - 13 <<EOF
+  > pick 49f5f2d940c3 14 backout #11
+  > pick 01a68de1003a 13 9foobranch
+  > EOF
+
   $ cd ..