[PATCH 1 of 3] keyword: remove mq commands from restricted list
Christian Ebert
blacktrash at gmx.net
Sun Apr 25 21:05:50 CDT 2010
# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1272246858 -7200
# Node ID 521ac0eb507b808b93093110727b93b9e7c6e378
# Parent f2340d699e79cefbc66630834465967255d2f6eb
keyword: remove mq commands from restricted list
Monkeypatching patch.diff takes care of this since 911f5be5d159.
Test mq more thoroughly by loosening [keywordmaps] and comparing
the output of hg cat with keyword expansion enabled and disabled.
diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -92,8 +92,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 record resolve qfold qimport qnew qpush qrefresh qrecord'
- ' transplant')
+restricted = 'merge record qrecord resolve transplant'
# provide cvs-like UTC date filter
utcdate = lambda x: util.datestr((x[0], 0), '%Y/%m/%d %H:%M:%S')
diff --git a/tests/test-keyword b/tests/test-keyword
--- a/tests/test-keyword
+++ b/tests/test-keyword
@@ -21,7 +21,7 @@
cat <<EOF >> $HGRCPATH
[keyword]
-* =
+** =
b = ignore
[hooks]
commit=
@@ -153,6 +153,10 @@
hg qgoto mqtest.diff
echo % cat
cat c
+echo % hg cat
+hg cat c
+echo % keyword should not be expanded in filelog
+hg --config 'extensions.keyword=!' cat c
echo % qpop and move on
hg qpop
diff --git a/tests/test-keyword.out b/tests/test-keyword.out
--- a/tests/test-keyword.out
+++ b/tests/test-keyword.out
@@ -158,6 +158,12 @@
% cat
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
tests for different changenodes
+% hg cat
+$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
+tests for different changenodes
+% keyword should not be expanded in filelog
+$Id$
+tests for different changenodes
% qpop and move on
popping mqtest.diff
patch queue now empty
@@ -208,7 +214,7 @@
[extensions]
keyword =
[keyword]
-* =
+** =
b = ignore
demo.txt =
[keywordmaps]
More information about the Mercurial-devel
mailing list