[PATCH 2 of 2] rollback: only restore dirstate (et. al.) when appropriate

Matt Mackall mpm at selenic.com
Fri Sep 16 14:42:57 CDT 2011


On Thu, 2011-09-15 at 22:22 -0400, Greg Ward wrote:
> # HG changeset patch
> # User Greg Ward <greg at gerg.ca>
> # Date 1316139696 14400
> # Node ID b33ba776a9977a4b1460eebb5acd9dc954da03c5
> # Parent  23fe96275fabc99c33f61da305f81948ea5c61df
> rollback: only restore dirstate (et. al.) when appropriate.
> 
> If the working dir parent is not one of the changesets slated for
> destruction, then this rollback should not affect the working dir:
> that means do not restore dirstate, branch, or bookmarks.
> 
> This is very preliminary, just posted for initial review. Some tests
> still fail.


> +            oldlen = int(oldlen)
> +            oldtip = oldlen - 1
> +            doomed = range(oldlen, len(self))

I think it would be better to simply truncate history and then see if
the working directory parent has vanished rather than looking at the
may-not-be-present-or-correct transaction description.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list