# HG changeset patch # User Christian Ebert # Date 1202320009 -3600 # Node ID 17e94f77de6a9da92869e767a47e124b8eb9841a # Parent 0683aaf458d82e69815c345c5684b81c46dc8edb Prevent expansion in queue repo and for email Saveguard needed for global [keyword] filename patterns. diff -r 0683aaf458d8 -r 17e94f77de6a hgkw/keyword.py --- 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:]) diff -r 0683aaf458d8 -r 17e94f77de6a tests/test-keyword --- 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 diff -r 0683aaf458d8 -r 17e94f77de6a tests/test-keyword.out --- 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