experiments with multi-rev undo

Kevin Smith yarcs at qualitycode.com
Sat Jul 9 02:39:51 UTC 2005


Andrea Arcangeli wrote:
> I don't see this breakage and what's wrong about the model that prevents
> a multiple undo, when a tar.gz will obviously do the two level undo just
> fine. The one level undo just looks an hack.

I tend to agree with this. I understand the desire to protect users from 
doing something awkward and dangerous, but single-level undo already 
breaks that. Meanwhile, we are prevented from doing something really 
handy, and are forced to use awkward workarounds outside of hg (like 
keeping tarball backups of repos).

My proposal would be:

1. Eliminate the existing undo command
2. Add the ability to specify a revision as part of clone, such that 
that revision becomes the tip in the new repo.

With that, it should be easy enough to create some external scripts that 
simulate an in-place multi-level undo. But at the same time, novice 
users are actually safer than today, because simple undo isn't available.

The main issue I can see with this is with multiple heads.

A -> B -> C -> D
  \-> E ->/

In this case, if we cloned up to "B", would the new repo contain "E" or 
not? I think a command-line option should decide between keeping ONLY 
parents of the target, or keeping everything except descendents of the 
target.

Kevin



More information about the Mercurial mailing list