# HG changeset patch # User Pierre-Yves David # Date 1444109397 25200 # Node ID b38d93735a4fc8a4597199e21ca6c7f81bdabf81 # Parent e28102403d1b886237bf1340bbed4f826bcd6882 discovery: rename 'error' to 'errormsg' The variable 'error' conflict with the module name that we would like to import and use in a coming changeset. diff -r e28102403d1b -r b38d93735a4f mercurial/discovery.py --- a/mercurial/discovery.py Mon Oct 05 16:44:45 2015 -0700 +++ b/mercurial/discovery.py Mon Oct 05 22:29:57 2015 -0700 @@ -284,7 +284,7 @@ # 3. Check for new heads. # If there are more heads after the push than before, a suitable # error message, depending on unsynced status, is displayed. - error = None + errormsg = None # If there is no obsstore, allfuturecommon won't be used, so no # need to compute it. if repo.obsstore: @@ -354,9 +354,9 @@ if remoteheads is None: if len(newhs) > 1: dhs = list(newhs) - if error is None: - error = (_("push creates new branch '%s' " - "with multiple heads") % (branch)) + if errormsg is None: + errormsg = (_("push creates new branch '%s' " + "with multiple heads") % (branch)) hint = _("merge or" " see \"hg help push\" for details about" " pushing new heads") @@ -364,17 +364,17 @@ # remove bookmarked or existing remote heads from the new heads list dhs = sorted(newhs - bookmarkedheads - oldhs) if dhs: - if error is None: + if errormsg is None: if branch not in ('default', None): - error = _("push creates new remote head %s " - "on branch '%s'!") % (short(dhs[0]), branch) + errormsg = _("push creates new remote head %s " + "on branch '%s'!") % (short(dhs[0]), branch) elif repo[dhs[0]].bookmarks(): - error = _("push creates new remote head %s " - "with bookmark '%s'!") % ( - short(dhs[0]), repo[dhs[0]].bookmarks()[0]) + errormsg = _("push creates new remote head %s " + "with bookmark '%s'!") % ( + short(dhs[0]), repo[dhs[0]].bookmarks()[0]) else: - error = _("push creates new remote head %s!" - ) % short(dhs[0]) + errormsg = _("push creates new remote head %s!" + ) % short(dhs[0]) if unsyncedheads: hint = _("pull and merge or" " see \"hg help push\" for details about" @@ -389,5 +389,5 @@ repo.ui.note(_("new remote heads on branch '%s':\n") % branch) for h in dhs: repo.ui.note((" %s\n") % short(h)) - if error: - raise util.Abort(error, hint=hint) + if errormsg: + raise util.Abort(errormsg, hint=hint)