changeset 20051:b988b3b19303

discovery: make note messages for new heads more readable
author Mads Kiilerich <madski@unity3d.com>
date Sat, 16 Nov 2013 15:46:29 -0500
parents 877e05b46509
children 79d3b6a45351
files mercurial/discovery.py tests/test-push-warn.t
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/discovery.py	Sat Nov 16 15:46:29 2013 -0500
+++ b/mercurial/discovery.py	Sat Nov 16 15:46:29 2013 -0500
@@ -337,10 +337,12 @@
                     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)
 
--- a/tests/test-push-warn.t	Sat Nov 16 15:46:29 2013 -0500
+++ b/tests/test-push-warn.t	Sat Nov 16 15:46:29 2013 -0500
@@ -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]