[PATCH 1 of 2] Hg pull doesn't suggest running hg merge when added heads are on different branches

Benoit Boissinot bboissin at gmail.com
Sat Mar 12 09:43:33 CST 2011


On Sat, Mar 12, 2011 at 3:56 AM, Kevin Berridge
<kevin.w.berridge at gmail.com> wrote:
> # HG changeset patch
> # User Kevin Berridge <kevin.w.berridge at gmail.com>
> # Date 1299894192 18000
> # Node ID 91ce954ac34a868124f49570e72aca4b012ac43c
> # Parent  1bb2a56a9d73b386378564381807fdf8df38ea3f
> Hg pull doesn't suggest running hg merge when added heads are on different branches.

Hi Kevin,

Couple of remarks:
- we usually format the commit message in a different way:
http://mercurial.selenic.com/wiki/ContributingChanges#Patch_descriptions
- can you try not adding a new test file and possibly reuse a test?

Otherwise looks good.

Benoit

> diff -r 1bb2a56a9d73 -r 91ce954ac34a mercurial/commands.py
> --- a/mercurial/commands.py     Thu Mar 10 13:43:47 2011 +0100
> +++ b/mercurial/commands.py     Fri Mar 11 20:43:12 2011 -0500
> @@ -2891,7 +2891,10 @@
>         else:
>             ui.status(_("not updating, since new heads added\n"))
>     if modheads > 1:
> -        ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))
> +        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"))
>     else:
>         ui.status(_("(run 'hg update' to get a working copy)\n"))
>
> diff -r 1bb2a56a9d73 -r 91ce954ac34a tests/test-pull-branch2.t
> --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
> +++ b/tests/test-pull-branch2.t Fri Mar 11 20:43:12 2011 -0500
> @@ -0,0 +1,30 @@
> +  $ hg init t
> +  $ cd t
> +  $ echo 1 > foo
> +  $ hg ci -Am1
> +  adding foo
> +
> +  $ cd ..
> +  $ hg clone ./t ./tt
> +  updating to branch default
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ cd ./tt
> +  $ hg branch A
> +  marked working directory as branch A
> +  $ echo 2 > foo
> +  $ hg ci -Am2
> +
> +  $ cd ../t
> +  $ echo a2 > foo
> +  $ hg ci -ma3
> +
> +Pull branch A:
> +
> +  $ hg pull ../tt
> +  pulling from ../tt
> +  searching for changes
> +  adding changesets
> +  adding manifests
> +  adding file changes
> +  added 1 changesets with 1 changes to 1 files (+1 heads)
> +  (run 'hg heads' to see heads)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>


More information about the Mercurial-devel mailing list