[PATCH 2 of 2] commit: fix the dirstate race from issue2264 for all scripts/extensions

Greg Ward greg-hg at gerg.ca
Sun Jan 30 15:24:17 CST 2011


On Sat, Jan 29, 2011 at 4:11 PM, Greg Ward <greg-hg at gerg.ca> wrote:
> # HG changeset patch
> # User Greg Ward <greg-hg at gerg.ca>
> # Date 1296335278 18000
> # Branch stable
> # Node ID 4a74ec2ae4f1359c27bf82fbf00646ad1e32ea04
> # Parent  10d88a8557f9eaa7e681bba661d49cf6081b5e5b
> commit: fix the dirstate race from issue2264 for all scripts/extensions.
[...]
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -968,9 +968,13 @@
>                         _('note: commit message saved in %s\n') % msgfn)
>                 raise
>
> -            # update dirstate and mergestate
> +            # update dirstate and mergestate: call normallookup(),
> +            # rather than normal(), in case we do a second commit in the
> +            # same process in the same second while holding the same
> +            # repo lock, and the second commit modifies a file without
> +            # changing its size (issue2264)
>             for f in changes[0] + changes[1]:
> -                self.dirstate.normal(f)
> +                self.dirstate.normallookup(f)

OOOPS!!!  Please ignore this patch -- it breaks lots of tests.
Clearly I still don't understand this stuff well enough.

Matt, my original patch to transplant is still good: it makes
transplant better even if it doesn't solve the problem for other
extensions or scripts.  I'm pretty confident that it's OK for 1.7.4.
Not sure if I'll be able to get anything more ambitious than that by
Tuesday though.  And that might be a 1.8 change anyways.  I have
something cooking in my working dir, but 1) it doesn't work yet and 2)
it feels a little too risky for stable so far.

Greg


More information about the Mercurial-devel mailing list