prepush: eliminate 'if branch'
authorAdrian Buehlmann <adrian@cadifra.com>
Fri, 03 Jun 2011 11:26:43 +0200
changeset 14524 97d2259af787
parent 14523 b4175b72bbd8
child 14525 826a13720fbc
prepush: eliminate 'if branch' branch is always set anyway No change in program behavior.
mercurial/discovery.py
--- 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: