Prevent expansion in queue repo and for email
authorChristian Ebert <blacktrash@gmx.net>
Wed, 06 Feb 2008 18:46:49 +0100
changeset 381 17e94f77de6a
parent 378 0683aaf458d8
child 382 e8d4a289f8e4
Prevent expansion in queue repo and for email Saveguard needed for global [keyword] filename patterns.
hgkw/keyword.py
tests/test-keyword
tests/test-keyword.out
--- a/hgkw/keyword.py	Wed Feb 06 17:25:37 2008 +0100
+++ b/hgkw/keyword.py	Wed Feb 06 18:46:49 2008 +0100
@@ -90,7 +90,7 @@
 
 # hg commands that do not act on keywords
 nokwcommands = ('add addremove bundle copy export grep identify incoming init'
-                ' log outgoing push remove rename rollback tip convert')
+                ' log outgoing push remove rename rollback tip convert email')
 
 # hg commands that trigger expansion only when writing to working dir,
 # not when reading filelog, and unexpand when reading from working dir
@@ -412,7 +412,7 @@
     This is done for local repos only, and only if there are
     files configured at all for keyword substitution.'''
 
-    if not repo.local():
+    if not repo.local() or repo.root.endswith('/.hg/patches'):
         return
 
     hgcmd, func, args, opts, cmdopts = dispatch._parse(ui, sys.argv[1:])
--- a/tests/test-keyword	Wed Feb 06 17:25:37 2008 +0100
+++ b/tests/test-keyword	Wed Feb 06 18:46:49 2008 +0100
@@ -90,8 +90,12 @@
 echo % compare changenodes in a c
 cat a c
 
+echo % qinit -c
+hg qinit -c
 echo % qimport
 hg qimport -r tip -n mqtest.diff
+echo % qcommit
+hg qcommit -mqtest
 echo % keywords should not be expanded in patch
 cat .hg/patches/mqtest.diff
 echo % qpop
--- a/tests/test-keyword.out	Wed Feb 06 17:25:37 2008 +0100
+++ b/tests/test-keyword.out	Wed Feb 06 18:46:49 2008 +0100
@@ -162,7 +162,9 @@
 xxx $
 $Id: c,v ba4426d1938e 1970/01/01 00:00:01 user $
 tests for different changenodes
+% qinit -c
 % qimport
+% qcommit
 % keywords should not be expanded in patch
 # HG changeset patch
 # User User Name <user@example.com>