Patchwork [5,of,8] discovery: tweak error message for multiple branch heads

login
register
mail settings
Submitter Mads Kiilerich
Date Nov. 17, 2013, 4:29 p.m.
Message ID <de7385c8e0bc3227a2ad.1384705741@localhost.localdomain>
Download mbox | patch
Permalink /patch/3012/
State Accepted
Commit 877e05b46509d462cf0a698c21dbf383c710f874
Headers show

Comments

Mads Kiilerich - Nov. 17, 2013, 4:29 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1384634789 18000
#      Sat Nov 16 15:46:29 2013 -0500
# Branch stable
# Node ID de7385c8e0bc3227a2ad5b38ce4eb2e4b6b95801
# Parent  05bbbe484c2a01396babd2a7e3cf0599254fb157
discovery: tweak error message for multiple branch heads
Mads Kiilerich - Nov. 17, 2013, 4:42 p.m.
On 11/17/2013 11:29 AM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1384634789 18000
> #      Sat Nov 16 15:46:29 2013 -0500
> # Branch stable
> # Node ID de7385c8e0bc3227a2ad5b38ce4eb2e4b6b95801
> # Parent  05bbbe484c2a01396babd2a7e3cf0599254fb157
> discovery: tweak error message for multiple branch heads

This one should perhaps go to stable.

/Mads

>
> diff --git a/mercurial/discovery.py b/mercurial/discovery.py
> --- a/mercurial/discovery.py
> +++ b/mercurial/discovery.py
> @@ -313,8 +313,8 @@ def checkheads(repo, remote, outgoing, r
>               if 1 < len(newhs):
>                   dhs = list(newhs)
>                   if error is None:
> -                    error = (_("push creates multiple headed new branch '%s'")
> -                             % (branch))
> +                    error = (_("push creates new branch '%s' "
> +                               "with multiple heads") % (branch))
>                       hint = _("merge or"
>                                " see \"hg help push\" for details about"
>                                " pushing new heads")
> diff --git a/tests/test-push-warn.t b/tests/test-push-warn.t
> --- a/tests/test-push-warn.t
> +++ b/tests/test-push-warn.t
> @@ -367,7 +367,7 @@ Pushing muliple headed new branch:
>     $ hg push --branch f --new-branch ../f
>     pushing to ../f
>     searching for changes
> -  abort: push creates multiple headed new branch 'f'
> +  abort: push creates new branch 'f' with multiple heads
>     (merge or see "hg help push" for details about pushing new heads)
>     [255]
>     $ hg push --branch f --new-branch --force ../f

Patch

diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -313,8 +313,8 @@  def checkheads(repo, remote, outgoing, r
             if 1 < len(newhs):
                 dhs = list(newhs)
                 if error is None:
-                    error = (_("push creates multiple headed new branch '%s'")
-                             % (branch))
+                    error = (_("push creates new branch '%s' "
+                               "with multiple heads") % (branch))
                     hint = _("merge or"
                              " see \"hg help push\" for details about"
                              " pushing new heads")
diff --git a/tests/test-push-warn.t b/tests/test-push-warn.t
--- a/tests/test-push-warn.t
+++ b/tests/test-push-warn.t
@@ -367,7 +367,7 @@  Pushing muliple headed new branch:
   $ hg push --branch f --new-branch ../f
   pushing to ../f
   searching for changes
-  abort: push creates multiple headed new branch 'f'
+  abort: push creates new branch 'f' with multiple heads
   (merge or see "hg help push" for details about pushing new heads)
   [255]
   $ hg push --branch f --new-branch --force ../f