[PATCH] changegroup: do not prompt to merge after adding only closed heads (issue2697)

Kevin Gessner kevin at fogcreek.com
Thu Apr 14 15:53:52 CDT 2011


On Thu, Apr 14, 2011 at 4:40 PM, Adrian Buehlmann <adrian at cadifra.com> wrote:
> Kevin came up with an improvement for the change message. Which leads to
> the question of if we really need to know how many closed heads were added.

As you might guess, I believe we do -- and see issue2697. The standard
output from `hg pull` when a new head is added is something like:

    added 7 changesets with 13 changes to 9 files (+1 heads)
    (run 'hg heads' to see heads, 'hg merge' to merge)

If the added head is closed, then `hg heads` will not let you see the
head, and `hg merge` will not merge with it. Thus, the message should
say to run `hg update` (and with this patch, it does).

Now, it's also useful to note how many of the added heads are closed,
to prevent the following messages from both being possible after a
pull:

    added 7 changesets with 13 changes to 9 files (+1 heads)
    (run 'hg heads' to see heads, 'hg merge' to merge)

    added 7 changesets with 13 changes to 9 files (+1 heads)
    (run 'hg update' to get a working copy)

The pertinent difference is that in the first case, the added head is
opened; in the second, it's closed. Amending the second message to
"(+1 heads, 1 closed)" makes it clear that the second operation is
different from the first, and so has a different set of suggestions.

-- Kevin


More information about the Mercurial-devel mailing list