[PATCH] update: when failing to merge, mention how to abandon the update (issue1431)

Brodie Rao brodie at bitheap.org
Sun Feb 20 02:48:10 CST 2011


On Sun, Feb 20, 2011 at 12:34 AM, Gilles Moris <gilles.moris at free.fr> wrote:
> On Sunday 20 February 2011 06:59:26 am Brodie Rao wrote:
>> # HG changeset patch
>> # User Brodie Rao <brodie at bitheap.org>
>> # Date 1298181399 28800
>> # Node ID a8fc9b1309a82eaea2a0454809678c8d53df9d48
>> # Parent  643b8212813e631b5525049fc4321a34a4def105
>> update: when failing to merge, mention how to abandon the update
>> (issue1431)
>>
>> Prior to the resolve command being added in 92ccccb55ba3, hg update
>> printed a similar message explaining how to retry the update.
>>
>> diff --git a/mercurial/hg.py b/mercurial/hg.py
>> --- a/mercurial/hg.py
>> +++ b/mercurial/hg.py
>> @@ -378,10 +378,12 @@ def _showstats(repo, stats):
>>
>>  def update(repo, node):
>>      """update the working directory to node, merging linear changes"""
>> +    pl = repo.parents()
>>      stats = mergemod.update(repo, node, False, False, None)
>>      _showstats(repo, stats)
>>      if stats[3]:
>> -        repo.ui.status(_("use 'hg resolve' to retry unresolved file
>> merges\n")) +        repo.ui.status(_("use 'hg resolve' to retry unresolved
>> file merges " +                         "or 'hg update %s' to abandon\n") %
>> pl[0].rev())
>
> You mean: "hg update --clean ."

No, I don't. This message is for hg update, not hg merge. Doing "hg
update --clean ." would not put you back to a state prior to running
hg update; it would keep you at the revision you just updated to and
delete all of your modifications, including the ones that caused the
merge conflicts in the first place.

> Regards.
> Gilles.
>


More information about the Mercurial-devel mailing list