Mercurial wipes repository history!?

Masklinn masklinn at masklinn.net
Fri Apr 9 05:10:35 CDT 2010


On 9 Apr 2010, at 12:00 , Sune Foldager wrote:
> 
> On 09-04-2010 11:28, Jon Ribbens wrote:
>> On Thu, Apr 08, 2010 at 11:40:51AM -0500, Mark A. Flacy wrote:
>>>    I'll add that if you really believe that someone would never want to
>>>    rollback a clone, then they will not issue the command in the first
>>>    place.
>> 
>> That is obviously untrue - people can and will do it by mistake.
>> When the commands are entered all in a row like my shell log at the
>> start of this thread, then of course it's easy to see what's happening
>> and nobody's likely to do that in real life. However if you have a
>> repository that's been sitting there for days or weeks and you are
>> mistaken as to what the last thing that happened to it is, then the
>> repository suddenly going boom is fairly spectacularly suprising.
> 
> Yeah, so clone it again. It's not like there was any work in it that doesn't exist in another place.

Plus technically, rollback only rollbacks the pull part of clone, you don't
need to clone again, the repo's still here you just need to hg pull -u:

 $ hg clone http://selenic.com/repo/hello
destination directory: hello
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 $ cd hello
 $ hg log
changeset:   1:82e55d328c8c
tag:         tip
user:        mpm at selenic.com
date:        Fri Aug 26 01:21:28 2005 -0700
summary:     Create a makefile

changeset:   0:0a04b987be5a
user:        mpm at selenic.com
date:        Fri Aug 26 01:20:50 2005 -0700
summary:     Create a standard "hello, world" program

 $ hg rollback
rolling back last transaction
 $ hg log
 $ hg pull -u
pulling from http://selenic.com/repo/hello
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 $ hg log
changeset:   1:82e55d328c8c
tag:         tip
user:        mpm at selenic.com
date:        Fri Aug 26 01:21:28 2005 -0700
summary:     Create a makefile

changeset:   0:0a04b987be5a
user:        mpm at selenic.com
date:        Fri Aug 26 01:20:50 2005 -0700
summary:     Create a standard "hello, world" program




More information about the Mercurial mailing list