changeset 14524:97d2259af787

prepush: eliminate 'if branch' branch is always set anyway No change in program behavior.
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 03 Jun 2011 11:26:43 +0200
parents b4175b72bbd8
children 826a13720fbc
files mercurial/discovery.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/discovery.py	Fri Jun 03 20:32:54 2011 +0200
+++ b/mercurial/discovery.py	Fri Jun 03 11:26:43 2011 +0200
@@ -160,19 +160,15 @@
             oldhs = set(oldmap[branch])
             if len(newhs) > len(oldhs):
                 if error is None:
-                    if branch:
-                        error = _("push creates new remote heads "
-                                  "on branch '%s'!") % branch
-                    else:
-                        error = _("push creates new remote heads!")
+                    error = _("push creates new remote heads "
+                              "on branch '%s'!") % branch
                     if branch in unsynced:
                         hint = _("you should pull and merge or "
                                  "use push -f to force")
                     else:
                         hint = _("did you forget to merge? "
                                  "use push -f to force")
-                if branch:
-                    repo.ui.debug("new remote heads on branch '%s'\n" % branch)
+                repo.ui.debug("new remote heads on branch '%s'\n" % branch)
                 for h in (newhs - oldhs):
                     repo.ui.debug("new remote head %s\n" % short(h))
         if error: