# HG changeset patch # User Adrian Buehlmann # Date 1307093203 -7200 # Node ID 97d2259af7872bcbe7061fb87381cb6e082ddd63 # Parent b4175b72bbd888c8f2bc9d9d6034d5f7bfbbeaba prepush: eliminate 'if branch' branch is always set anyway No change in program behavior. diff -r b4175b72bbd8 -r 97d2259af787 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: