discovery: Fix error print mentioning a 'None' branch stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 17 Oct 2011 11:37:59 +0200
branchstable
changeset 15292 7fa471248185
parent 15291 1fead3ad7874
child 15293 0e34699d6988
discovery: Fix error print mentioning a 'None' branch When talking to old server discovery use heads of the 'None' branch to refer to topological heads. This use of None should never make it to the end user.
mercurial/discovery.py
--- a/mercurial/discovery.py	Mon Oct 17 14:14:28 2011 -0500
+++ b/mercurial/discovery.py	Mon Oct 17 11:37:59 2011 +0200
@@ -161,7 +161,7 @@
             if len(newhs) > len(oldhs):
                 dhs = list(newhs - oldhs)
                 if error is None:
-                    if branch != 'default':
+                    if branch not in ('default', None):
                         error = _("push creates new remote head %s "
                                   "on branch '%s'!") % (short(dhs[0]), branch)
                     else:
@@ -173,7 +173,8 @@
                     else:
                         hint = _("did you forget to merge? "
                                  "use push -f to force")
-                repo.ui.note("new remote heads on branch '%s'\n" % branch)
+                if branch is not None:
+                    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))
         if error: