LWN.net Logo

Hg Init: a Mercurial tutorial

Hg Init: a Mercurial tutorial

Posted Feb 24, 2010 19:45 UTC (Wed) by bjacob (subscriber, #58566)
In reply to: Hg Init: a Mercurial tutorial by juliank
Parent article: Hg Init: a Mercurial tutorial

Except that 'hg push -f' has nothing to do with 'git push -f'.

Doing 'hg push -f' will, at worst, create a new head alongside the existing ones.

With Hg, the history is an immutable collection that can only grow; existing history is set in stone and can't be altered. You can only append to it.


(Log in to post comments)

Hg Init: a Mercurial tutorial

Posted Feb 25, 2010 14:06 UTC (Thu) by BenHutchings (subscriber, #37955) [Link]

History is most certainly mutable in Hg. Even without considering the mq extension, 'rollback' will remove the last changeset.

Hg Init: a Mercurial tutorial

Posted Feb 28, 2010 16:13 UTC (Sun) by bjacob (subscriber, #58566) [Link]

About rollback: OK but its effect is very limited: it affects only the last transaction.
About queues: it's a special enough case that their mutability doesn't mean that hg history as a whole is mutable...

Hg Init: a Mercurial tutorial

Posted Feb 28, 2010 16:14 UTC (Sun) by bjacob (subscriber, #58566) [Link]

For the record, I have just learnt that gitorious.org offers an option to disable "git push -f" altogether.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds