Mercurial wipes repository history!?

David Champion dgc at uchicago.edu
Thu Apr 8 12:05:33 CDT 2010


* On 08 Apr 2010, Giorgos Keramidas wrote: 
> On Thu, 8 Apr 2010 16:36:57 +0100, Jon Ribbens <jon-mercurial at unequivocal.co.uk> wrote:
> >
> > Indeed. I think it would be a really good idea if 'hg rollback' told
> > you what it was going to do before it did it, but obviously that's a
> > feature request not a bug report ;-)

It's always going to undo the last transaction. :) Your description
of this as "erasing the repository" is not how Mercurial sees it.
Mercurial just went back to the previous state of the repository, which
is as documented.

All this still applies only to the test case you presented, not the
situation your colleague encountered but that hasn't been reproduced.


> It may be sensible to change rollback in a future version of Mercurial
> to work similarly to the --remove-older option of rdiff-backup.  The

It seems that rollback does exactly one thing, and it's pretty
straightforward to understand what it's going to do once you have a
feel for what constitutes a transaction in Mercurial.  That's the
only difficult aspect of this scenario: it's not obvious to a new
user.  Adding new protections to the command seems only to complicate
intentional usage.

Rollback functionality is essential to Mercurial's internals, but what
about moving the rollback command to a distributed extension?  Then
nobody can casually try it without making an explicit decision to take
those risks, but once enabled it will always be available.

-- 
 -D.    dgc at uchicago.edu    IT Services    University of Chicago


More information about the Mercurial mailing list