[PATCH 2 of 2] pull: new output message suggests better update action when a new branch head is added

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Mar 15 11:51:56 CDT 2011


On Mar 14, 2011, at 9:22 PM, Kevin Berridge wrote:

> # HG changeset patch
> # User Kevin Berridge <kevin.w.berridge at gmail.com>
> # Date 1299894913 18000
> # Node ID af5a7dd472ad2056475e870979dd01a8aafd3df5
> # Parent  74e518e0dc1418c01584cd7efb9bda53e97fb7e2
> pull: new output message suggests better update action when a new branch head is added
> 
> This patch changes the output message from hg pull when new heads are added on other branches but not on the current branch to "(new branch heads added, run 'hg update [new branch]' to get a working copy)"
> 
> diff -r 74e518e0dc14 -r af5a7dd472ad mercurial/commands.py
> --- a/mercurial/commands.py	Fri Mar 11 20:43:12 2011 -0500
> +++ b/mercurial/commands.py	Fri Mar 11 20:55:13 2011 -0500
> @@ -2894,7 +2894,8 @@
>         if (len(repo.branchheads()) > 1):
>             ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))
>         else:
> -            ui.status(_("(run 'hg heads' to see heads)\n"))
> +            ui.status(_("(new branch heads added, run 'hg update" +
> +              " [new branch]' to get a working copy)\n"))
>     else:
>         ui.status(_("(run 'hg update' to get a working copy)\n"))
> 
> diff -r 74e518e0dc14 -r af5a7dd472ad tests/test-pull-branch.t
> --- a/tests/test-pull-branch.t	Fri Mar 11 20:43:12 2011 -0500
> +++ b/tests/test-pull-branch.t	Fri Mar 11 20:55:13 2011 -0500
> @@ -160,4 +160,4 @@
>   adding manifests
>   adding file changes
>   added 1 changesets with 1 changes to 1 files (+1 heads)
> -  (run 'hg heads' to see heads)
> +  (new branch heads added, run 'hg update [new branch]' to get a working copy)

Yeah, this seems a little strange to me, first because you wouldn't know what '[new branch]' is without first running 'hg branches'.

I'd be more in favor of something like:

(new branches added, run 'hg branches' to see branches)

even though that is a bit repetitive and wordy...

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock



More information about the Mercurial-devel mailing list