Mercurial > hg
view README @ 24995:0579b0c2ea2b
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 07 May 2015 12:07:11 +0900 |
parents | df5ecb813426 |
children | 4b0fc75f9403 |
line wrap: on
line source
Mercurial ========= Mercurial is a fast, easy to use, distributed revision control tool for software developers. Basic install: $ make # see install targets $ make install # do a system-wide install $ hg debuginstall # sanity-check setup $ hg # see help Running without installing: $ make local # build for inplace usage $ ./hg --version # should show the latest version See http://mercurial.selenic.com/ for detailed installation instructions, platform-specific notes, and Mercurial user information.