[PATCH 1 of 2] rebase: ensure we can abort from a stale rebase

Jason Harris jason.f.harris at gmail.com
Mon Nov 22 15:07:06 CST 2010


On Nov 22, 2010, at 9:41 PM, Matt Mackall wrote:

> On Sun, 2010-11-21 at 19:31 +0100, Jason Harris wrote: 
>> # HG changeset patch
>> # User jfh <jason at jasonfharris.com>
>> # Date 1290363222 -3600
>> # Node ID ec298433080bb12de80ad9657abb1bdad65fdcba
>> # Parent  a9dac2fb64b7ad324669f37798b3abfa3ef53086
>> rebase: ensure we can abort from a stale rebase
>> 
>> After doing a rebase which fails (due to conflicts, etc), and then removing the
>> changesets the rebase referenced, we cannot later exit from the rebase by using
>> rebase --abort.  That is, while rebase is setting up to do the abort of the
>> previous rebase, an exception is raised since it can't find the previous
>> changesets in the repo and so the rebase --abort terminates before resetting the
>> rebasestate.  Repeated uses of rebase --abort will not get around this.
> 
> That's is a pretty ugly bug you've found. I'm afraid your fix is less
> than ideal, though.

Yep. I thought there would likely be a better way which you guys would know :)

I also thought that in the end my solution would fall by the wayside, but at least the write up would serve for someone to easily follow the actual bug and test for it.

> In a normal abort. we strip the changesets we've
> rebased so far, switch the working directory back to where we started,
> and then say:
> 
>        repo.ui.warn(_('rebase aborted\n'))
> 
> In your patch, we leave everything as it is and say:
> 
> +                    repo.ui.warn(_('previous rebase aborted\n'))
> 
> So we've got two very different results (one good and one a mess) that
> are nearly indistinguishable from their output.

Yep. Much less than ideal. Ideally I would guess we need a "super"-roll back? Or some snapshotting mechanism or something... but of course you guys will know this much better than me...

> Also, this only 'fixes' one path where we read this damaged/dated file,
> which means we probably want to look at fixing this differently.

Of course. Glad I could at least help brining the bug to light... :)

Cheers,
  Jas

> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list