Improving "abort: can't merge with ancestor"

Dan Villiom Podlaski Christiansen danchr at gmail.com
Tue Apr 6 15:28:10 CDT 2010


On 6 Apr 2010, at 21:24, Greg Ward wrote:

> When "hg merge" finds that there is nothing to merge, it emits the
> rather cryptic message
> 
>  abort: can't merge with ancestor

I think two other messages could also use a bit of improvement:

Using ‘hg merge’ when only branch head exists will yield ‘abort: there is nothing to merge’.

Trying to merge with a descendent will yield ‘abort: nothing to merge (use 'hg update' or check 'hg heads')’.

> I suspect that the set of people who understand that message is
> roughly equal to the set of people reading this list.  I.e. end users
> are confused by it.  (I sure was the first time I saw it, and I get
> asked "what does this mean?" fairly regularly by my users.)
> 
> Here's my idea for improving it:
> 
>  abort: nothing to merge: merge source (960ab17c3c4e) already an
> ancestor of target
> 
> Not sure if including the cset id is a good idea.  It makes the
> English message 82 chars, which is about... umm... 12 chars too long.
> Gee, where can I save 12 chars from that message?  ;-)

I think changing the messages to include a description what was attempted is a good idea. Even ignoring the issue of length, I'm not sure how meaningful the hash is.

Here's a few ideas:

abort: nothing to merge found (the given changeset is an ancestor of this changeset)
abort: nothing to merge found (this changeset already descends from the given changeset)
(or vice versa for the reverse case)

abort: nothing to merge found (branch '%s' only contains one head)
abort: nothing to merge found (the default branch only contains one head)

--

Dan Villiom Podlaski Christiansen
danchr at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1943 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100406/d39ea1e6/attachment.bin>


More information about the Mercurial-devel mailing list