##// END OF EJS Templates
tryimportone: use dirstateguard instead of beginparentchange/endparentchange...
tryimportone: use dirstateguard instead of beginparentchange/endparentchange To fix the issue that the recent (in memory) dirstate isn't visible to external process (e.g. "precommit" hook), a subsequent patch makes "localrepository.commit()" invoke "dirstate.write()" in it. This change will make "beginparentchange()" and "endparentchange()" on dirstate in "cmdutil.tryimportone()" meaningless, because: - "dirstate.write()" writes changed data into ".hg/dirstate", but - aborting between "beginparentchange()" and "endparentchange()" doesn't cause any restoring ".hg/dirstate" it just discards changes in memory. This patch uses "dirstateguard" instead of "beginparentchange()" and "endparentchange()" in "cmdutil.tryimportone()" to restore ".hg/dirstate" during a failure even if "dirstate.write()" is executed before a failure. This patch uses "lockmod.release(dsguard)" instead of "dsguard.release()", because processing may be aborted before assignment to "dsguard" , and the "if dsguard" examination for safety is redundant.

File last commit:

r16913:f2719b38 default
r24995:0579b0c2 default
Show More
test-issue1089.t
26 lines | 321 B | text/troff | Tads3Lexer
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 http://mercurial.selenic.com/bts/issue1089
Adrian Buehlmann
tests: unify test-issue*
r12195
$ hg init
$ mkdir a
$ echo a > a/b
$ hg ci -Am m
adding a/b
$ hg rm a
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 removing a/b (glob)
Adrian Buehlmann
tests: unify test-issue*
r12195 $ hg ci -m m a
$ mkdir a b
$ echo a > a/b
$ hg ci -Am m
adding a/b
$ hg rm a
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 removing a/b (glob)
Adrian Buehlmann
tests: unify test-issue*
r12195 $ cd b
Relative delete:
$ hg ci -m m ../a
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..