Mercurial > public > mercurial-scm > hg-stable
diff mercurial/rewriteutil.py @ 46114:59fa3890d40a
node: import symbols explicitly
There is no point in lazy importing mercurial.node, it is used all over
the place anyway. So consistently import the used symbols directly.
Fix one file using symbols indirectly via mercurial.revlog.
Differential Revision: https://phab.mercurial-scm.org/D9480
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Tue, 01 Dec 2020 21:54:46 +0100 |
parents | b4694ef45db5 |
children | 7001f92e0ee9 |
line wrap: on
line diff
--- a/mercurial/rewriteutil.py Sun Dec 13 18:29:22 2020 -0800 +++ b/mercurial/rewriteutil.py Tue Dec 01 21:54:46 2020 +0100 @@ -10,10 +10,13 @@ import re from .i18n import _ +from .node import ( + hex, + nullrev, +) from . import ( error, - node, obsolete, obsutil, revset, @@ -30,7 +33,7 @@ Make sure this function is called after taking the lock. """ - if node.nullrev in revs: + if nullrev in revs: msg = _(b"cannot %s null changeset") % action hint = _(b"no changeset checked out") raise error.InputError(msg, hint=hint) @@ -113,7 +116,7 @@ if len(successors) == 1 and len(successors[0]) == 1: successor = successors[0][0] if successor is not None: - newhash = node.hex(successor) + newhash = hex(successor) commitmsg = commitmsg.replace(h, newhash[: len(h)]) else: repo.ui.note(