Patchwork [6,of,8] discovery: make note messages for new heads more readable

login
register
mail settings
Submitter Mads Kiilerich
Date Nov. 17, 2013, 4:29 p.m.
Message ID <42bb45f0b844d959b665.1384705742@localhost.localdomain>
Download mbox | patch
Permalink /patch/3013/
State Accepted
Commit b988b3b19303463927b5f405a213f0766ba969b7
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 42bb45f0b844d959b665de133fc95c61b2f214c2
# Parent  de7385c8e0bc3227a2ad5b38ce4eb2e4b6b95801
discovery: make note messages for new heads more readable

Patch

diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -337,10 +337,12 @@  def checkheads(repo, remote, outgoing, r
                     hint = _("merge or"
                              " see \"hg help push\" for details about"
                              " pushing new heads")
-            if branch is not None:
-                repo.ui.note(_("new remote heads on branch '%s'\n") % branch)
+            if branch is None:
+                repo.ui.note(_("new remote heads:\n"))
+            else:
+                repo.ui.note(_("new remote heads on branch '%s':\n") % branch)
             for h in dhs:
-                repo.ui.note(_("new remote head %s\n") % short(h))
+                repo.ui.note((" %s\n") % short(h))
     if error:
         raise util.Abort(error, hint=hint)
 
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
@@ -38,8 +38,8 @@ 
   query 2; still undecided: 1, sample size is: 1
   2 total queries
   listing keys for "bookmarks"
-  new remote heads on branch 'default'
-  new remote head 1e108cc5548c
+  new remote heads on branch 'default':
+   1e108cc5548c
   abort: push creates new remote head 1e108cc5548c!
   (pull and merge or see "hg help push" for details about pushing new heads)
   [255]
@@ -129,9 +129,9 @@ 
   $ hg push -v -r 3 -r 4 ../c
   pushing to ../c
   searching for changes
-  new remote heads on branch 'default'
-  new remote head a5dda829a167
-  new remote head ee8fbc7a0295
+  new remote heads on branch 'default':
+   a5dda829a167
+   ee8fbc7a0295
   abort: push creates new remote head a5dda829a167!
   (merge or see "hg help push" for details about pushing new heads)
   [255]