Multiple undo again...

Martin Geisler mg at aragost.com
Fri Jun 4 08:39:46 CDT 2010


Jason Harris <jason at jasonfharris.com> writes:

This sounds like something that belongs on mercurial-devel only.

> [...]
>
> Now of course one might say "just be careful" when you do changes like
> reordering changesets, collapsing them etc. But the thing is, I
> *don't* want to be careful. I am likely thinking about a zillion other
> things and I am using MacHg or Mercurial on "auto-pilot" I want to do
> my changes and get back to what I was working on... A good system
> should be forgiving and so allow me to mess up and recover if I did
> mess up. Hopefully this is enough motivation to see why one wants
> multiple undo and redo in a system.

Instead of keeping full clones around for backup purposes, how do you
feel about my idea of simply leaving the "deleted" changesets around?

That is, when reordering

  A --- B --- C --- D

to

  A --- C' --- B' --- D'

we keep the old B, C, D around and mark them dead:


  A --- C' --- B' --- D'
   \
    B --- C --- D --- <X>

Here X is a new changeset which has a bit of metadata that tells
Mercurial to not push it anywhere[*].

Henrik and I (well, mostly Henrik) have been working on a set of
patches that implements this:

  http://bitbucket.org/mg/dead-branches/


[*] I think it would be nice if X are pushed to another repository if it
    already has some of B, C, D -- that is if the topological branch
    that X kills is already partyly pushed. Henrik does not like[**]
    this automatic spreading of dead heads. He says its impolite to
    spread corpses around automatically or something like that.

[**] My theory is that this is because he is not clever enough to
     implement it... :-)

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list