keyword: suppress keyword expansion while 'hg unshelve' for internal merge

Before this patch, 'hg unshelve' may cause unexpected conflict, if 'hg
unshelve'-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 unshelve' for
internal merge by adding 'unshelve' to 'restricted' command list like
'merge'.

--HG--
branch : stable
extra : rebase_source : 6595d2f5a12c949ab16fdcecece391b178911e5d
keyword: suppress keyword expansion while 'hg rebase' for internal merge

Before this patch, 'hg rebase' may cause unexpected conflict, if 'hg
rebase'-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 rebase' for internal
merge by adding 'rebase' to 'restricted' command list like 'merge'.

This patch specifies '--keep' to 'hg rebase', because revision #10 is
useful also for tests in succeeding patches.

--HG--
branch : stable
extra : rebase_source : e97c8aac72b6dde9f750c4f542bae6c6b1d43bc0
keyword: suppress keyword expansion while 'hg graft' for internal merge

Before this patch, 'hg graft' may cause unexpected conflict, if 'hg
graft'-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 graft' for internal
merge by adding 'graft' to 'restricted' command list like 'merge'.

--HG--
branch : stable
extra : rebase_source : 32330dcea72caac98cced6b8cf94888357b14f30
keyword: suppress keyword expansion while 'hg backout' for internal merge

Before this patch, 'hg backout' may cause unexpected conflict, if 'hg
backout'-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 backout' for
internal merge by adding 'backout' to 'restricted' command list like
'merge'.

--HG--
branch : stable
extra : rebase_source : 55e87b8e20d026f551d8af42c855e88752f53a0f
keyword: suppress keyword expansion while 'hg histedit' for internal merge

Before this patch, 'hg histedit' may cause unexpected conflict, if 'hg
histedit'-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 histedit' for
internal merge by adding 'histedit' to 'restricted' command list like
'merge'.

Test in this patch just swaps order of revision #13 and #14: this is
enough to cause internal merge.

--HG--
branch : stable
extra : rebase_source : 8f0334760840129676b09cf985594a5f90500edd
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'.

--HG--
branch : stable
extra : rebase_source : e2d60856d15e0865b093241b6943dec81eba8230
resolve: keep wlock while resolving

This will make resolve use correct locking and thus make it more safe.

Resolve is usually a long running command spending a lot of time waiting for
user input on hard problems. It is thus a real world scenario to start multiple
resolves at once or run other commands (such as up -C and merge) while resolve
is running. Proper locking prevents that.

--HG--
branch : stable
extra : rebase_source : 90bc9fcdd734a1094aafd3ceecb5616ce7694990