reverting changes nondestructively

Faheem Mitha faheem at email.unc.edu
Sat Dec 3 03:01:37 UTC 2005



On Fri, 2 Dec 2005, Robin Farine wrote:

> On Fri December 2 2005 03:24, Faheem Mitha wrote:
>
>> This (hg revert) appears to work, but I'm puzzled. The man page
>> says it reverts any uncommitted modifications. In that case, if
>> the modification has been made, it should be a no-op.
>>
>> I must be missing something, because if that is correct, then
>> specifying a revision is clearly redundant.
>
> Perhaps the '-r' option was added after documentation for revert has
> been written? The doc might say something like (this is probably
> neither good nor correct English but hopefully you get the idea):
>
>  "Reset the state of the named files or directories to the
>   tree's current revision or to a specific revision.
>   ... "

Ok, I submitted a bug report about this, 
http://www.selenic.com/mercurial/bts/issue87

>> BTW, does hg have any concept like svn about having the working
>> directory be at a particular revision?
>
> "hg identify" tells you the tree's current revision and "hg update
> REV" allows you to switch it to a specific revision.

This does not seem to work. In the following, fbcdd00bd0a9 is the tip. If 
I switch the working tree to an earlier revision, I get the same id, but 
with a '+' in front.

Anyway, I'd prefer to see a revision number here.

                                                                   Faheem.
**************************************************************************

faheem ~/scratch/debian-reference>hg identify
fbcdd00bd0a9 tip
faheem ~/scratch/debian-reference>hg revert -r 4
faheem ~/scratch/debian-reference>hg identify
fbcdd00bd0a9+ tip



More information about the Mercurial mailing list