hg rollback / hg revert / hg ?? a merge - hg merge could tell it to the user

Jason Harris jason at jasonfharris.com
Wed Jun 30 14:06:25 CDT 2010


On Jun 30, 2010, at 3:32 PM, Greg Ward wrote:

> On Tue, Jun 29, 2010 at 10:17 AM, Mads Kiilerich <mads at kiilerich.com> wrote:
>> On 06/29/2010 03:57 PM, Greg Ward wrote:
>>> IMHO there should not be a convenient alias for "update -C .".  The
>>> whole purpose of "update -C ." is to destroy information.  It throws
>>> away any uncommitted changes in your working directory.  It's
>>> *dangerous*!
>> 
>> The command is however so obscure and non-trivial that new users don't
>> understand it and how dangerous it is. They will blindly copy the command
>> and perhaps notice that it is a kind of "update", and they are perhaps
>> familiar with "update" and know that it normally isn't that dangerous. They
>> don't notice how big difference -C does, and they probably forget "." and
>> thus get unexpected behaviour.
> 
> Excellent point.
> 
>> I guess that most new users would be able to understand the seriousness and
>> remember a command like "hg nuke".
> 
> Random, thinking-out-loud ideas for other possible ways to say "hg update -C":
> 
>  hg update --discard-changes  (instead of --clean)

IMHO, I like this! I think its more readable than --clean.


>  hg discardchanges
>  hg merge --abort (analogous with transplant --abort, rebase --abort)

This would also be good...

> I think the latter two should really expand to "hg update -C .":
> aborting a merge means returning me back to where I was before I
> started the ill-fated merge.  Ditto for a hypothetical "discard
> changes" command.

Cheers,
  Jas


More information about the Mercurial-devel mailing list