Undo a commit?

rupert.thurner rupert.thurner at gmail.com
Wed Jul 15 07:36:12 CDT 2009


On Jul 15, 12:38 am, Martin Geisler <m... at lazybytes.net> wrote:
> "rupert.thurner" <rupert.thur... at gmail.com> writes:
> > is strip the same as rollback? and if yes why it has a different name?
>
> They overlap a bit, but are really quite different:
>
> * 'hg rollback' will remove the last transaction. Transactions are a
>   concept often found in databases. In Mercurial we start a transaction
>   when certain operations are run, such as commit, push, pull...
>
>   When the operation finishes succesfully, the transaction is marked as
>   complete. If an error occurs, the transaction is "rolled back" and the
>   repository is left in the same state as before.
>
>   You can manually trigger a rollback with 'hg rollback'. This will undo
>   the last transactional command. If a pull command brought 10 new
>   changesets into the repository on different branches, then 'hg
>   rollback' will remove them all.
>
>   Please not: there is *no backup* when you rollback a transaction!
>
> * 'hg strip' will remove a changeset and all its descendants. The
>   changesets are saved as a bundle, which you can apply again if you
>   need them back.
>
> --
> Martin Geisler

you are so right with your explanation, but our users feel that
stripping the last changeset and rolling back the last change set both
remove the last change set. and they ask, and they get a lengthy
explanation.

and they do not understand the various concepts of "backup". one time
its a .rej, then a .orig, then a bundle. they learn that "purge"
removes all these backups, but it is not valid for all of them, e.g.
strip bundles. merges which are not done need to be stopped with up --
clean.

if one looks at the wealth of commands in mercurial, it became quite a
challenge to get into it.  just to name a couple of examples:

* complicated command to do something simple and often needed:
  hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip

* different commands for approximately the same thing, e.g. undo/
clean:
  hg revert, hg backout, hg strip, hg rollback, hg update --clean, hg
purge

* asymetries:
  hg branch to create a branch
  hg commit to close it

what would be the best strategy to reduce the command and option set
and make it more intuitive?

rupert.



More information about the Mercurial mailing list