[PATCH STABLE RFC] transplant: avoid a dirstate race when transplanting multiple changesets

Greg Ward greg-hg at gerg.ca
Sat Jan 29 15:11:30 CST 2011


On Thu, Jan 27, 2011 at 1:40 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2011-01-27 at 09:44 -0500, Greg Ward wrote:
>> The above is *supposed* to be an abstraction of what transplant does
>> to expose the bug, but it doesn't work.  The two committed changesets
>> are fine.  Huh.  Any clue what I'm missing?
>
> I suspect it's related to locking. I think transplant holds a lock
> across multiple commits, which means it's not writing and reloading the
> dirstate.

Right you are: I just added locking to my little Python script, and I
can reproduce the same dirstate race that transplant was suffering
from.  New patches coming shortly.  I'm keeping them separate for the
time being; if you want me to fold them, just say the word.

Also, I didn't do anything about factoring out the innards of
dirstate.write() for reuse.  So this patch might do more work than is
strictly necessary.  It seems to work, though, and might be suitable
for stable.

Greg


More information about the Mercurial-devel mailing list