Mercurial > hg
comparison hgext/keyword.py @ 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 | c4633e287c56 |
comparison
equal
deleted
inserted
replaced
21707:e22cfd1ae97c | 21708:2668a78df8ba |
---|---|
101 ' outgoing push tip verify convert email glog') | 101 ' outgoing push tip verify convert email glog') |
102 | 102 |
103 # hg commands that trigger expansion only when writing to working dir, | 103 # hg commands that trigger expansion only when writing to working dir, |
104 # not when reading filelog, and unexpand when reading from working dir | 104 # not when reading filelog, and unexpand when reading from working dir |
105 restricted = ('merge kwexpand kwshrink record qrecord resolve transplant' | 105 restricted = ('merge kwexpand kwshrink record qrecord resolve transplant' |
106 ' unshelve rebase graft backout histedit') | 106 ' unshelve rebase graft backout histedit fetch') |
107 | 107 |
108 # names of extensions using dorecord | 108 # names of extensions using dorecord |
109 recordextensions = 'record' | 109 recordextensions = 'record' |
110 | 110 |
111 colortable = { | 111 colortable = { |