diff --git a/hgext/git/gitutil.py b/hgext/git/gitutil.py --- a/hgext/git/gitutil.py +++ b/hgext/git/gitutil.py @@ -1,8 +1,6 @@ """utilities to assist in working with pygit2""" -from mercurial.node import bin, hex, sha1nodeconstants - -from mercurial import pycompat +from mercurial.node import bin, sha1nodeconstants pygit2_module = None @@ -38,7 +36,7 @@ def togitnode(n): pygit2 and sqlite both need nodes as strings, not bytes. """ assert len(n) == 20 - return pycompat.sysstr(hex(n)) + return n.hex() def fromgitnode(n): diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -159,7 +159,7 @@ class BranchMapCache: def _unknownnode(node): """raises ValueError when branchcache found a node which does not exists""" - raise ValueError('node %s does not exist' % pycompat.sysstr(hex(node))) + raise ValueError('node %s does not exist' % node.hex()) def _branchcachedesc(repo): diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -647,9 +647,7 @@ class obsstore: if len(succ) != 20: raise ValueError(succ) if prec in succs: - raise ValueError( - 'in-marker cycle with %s' % pycompat.sysstr(hex(prec)) - ) + raise ValueError('in-marker cycle with %s' % prec.hex()) metadata = tuple(sorted(metadata.items())) for k, v in metadata: