Mercurial > hg
comparison tests/test-keyword.t @ 21708:2668a78df8ba stable
keyword: suppress keyword expansion while 'hg fetch' for internal merge
Before this patch, 'hg fetch' may cause unexpected conflict, if 'hg
fetch'-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 fetch' for internal
merge by adding 'fetch' to 'restricted' command list like 'merge'.
This patch uses 'hg import' to safely create the new head to be merged
at succeeding 'hg fetch', because:
- branch of revision #10 is different from one of #11 in 'Test'
repository, so just 'hg fetch -r 11' doesn't cause merging between
them
this means the new head should be created manually.
- 'hg import' is easier and safer than 'cat <<EOF' and 'hg commit'
to replay same changes including special characters like '$'
safeness of 'hg import' with keyword extension is already examined
in 'test-keyword.t'.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 05 Jun 2014 16:47:14 +0900 |
parents | e22cfd1ae97c |
children | db2392a4effc |
comparison
equal
deleted
inserted
replaced
21707:e22cfd1ae97c | 21708:2668a78df8ba |
---|---|
1282 $ hg histedit -q --command - 13 <<EOF | 1282 $ hg histedit -q --command - 13 <<EOF |
1283 > pick 49f5f2d940c3 14 backout #11 | 1283 > pick 49f5f2d940c3 14 backout #11 |
1284 > pick 01a68de1003a 13 9foobranch | 1284 > pick 01a68de1003a 13 9foobranch |
1285 > EOF | 1285 > EOF |
1286 | 1286 |
1287 Test restricted mode with fetch (with merge) | |
1288 | |
1289 $ cat <<EOF >> $HGRCPATH | |
1290 > [extensions] | |
1291 > fetch = | |
1292 > EOF | |
1293 | |
1294 $ hg clone -q -r 9 . ../fetch-merge | |
1295 $ cd ../fetch-merge | |
1296 $ hg -R ../Test export 10 | hg import -q - | |
1297 $ hg fetch -q -r 11 | |
1298 $ hg diff -r 9 a | |
1299 diff -r 800511b3a22d a | |
1300 --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1301 +++ b/a * (glob) | |
1302 @@ -1,4 +1,6 @@ | |
1303 +foobranch | |
1304 expand $Id$ | |
1305 do not process $Id: | |
1306 xxx $ | |
1307 $Xinfo$ | |
1308 +xxxx | |
1309 | |
1287 $ cd .. | 1310 $ cd .. |