diff -r 97d2259af787 -r 826a13720fbc mercurial/discovery.py --- a/mercurial/discovery.py Fri Jun 03 11:26:43 2011 +0200 +++ b/mercurial/discovery.py Fri Jun 03 12:16:17 2011 +0200 @@ -159,9 +159,14 @@ newhs = set(newmap[branch]) oldhs = set(oldmap[branch]) if len(newhs) > len(oldhs): + dhs = list(newhs - oldhs) if error is None: - error = _("push creates new remote heads " - "on branch '%s'!") % branch + if branch != 'default': + error = _("push creates new remote head %s " + "on branch '%s'!") % (short(dhs[0]), branch) + else: + error = _("push creates new remote head %s!" + ) % short(dhs[0]) if branch in unsynced: hint = _("you should pull and merge or " "use push -f to force") @@ -169,7 +174,7 @@ hint = _("did you forget to merge? " "use push -f to force") repo.ui.debug("new remote heads on branch '%s'\n" % branch) - for h in (newhs - oldhs): + for h in dhs: repo.ui.debug("new remote head %s\n" % short(h)) if error: raise util.Abort(error, hint=hint)