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

Greg Ward greg-hg at gerg.ca
Wed Jun 30 08:32:00 CDT 2010


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)
  hg discardchanges
  hg merge --abort (analogous with transplant --abort, rebase --abort)

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.

Note: I am not advocating adding *all* of these, just tossing out ideas.

I think that "hg nuke" is rather vague.  There are other ways to
destroy information than discarding local uncommitted changes.  Any
new command or option should IMHO combine verb (destroy, discard,
nuke, abort) and object (uncommitted changes, changes, local changes,
working dir state).

Greg


More information about the Mercurial-devel mailing list