--- a/mercurial/scmutil.py Sat Jun 03 19:01:19 2017 +0900
+++ b/mercurial/scmutil.py Sat Jun 03 19:12:01 2017 +0900
@@ -15,7 +15,11 @@
import socket
from .i18n import _
-from .node import wdirrev
+from .node import (
+ wdirid,
+ wdirrev,
+)
+
from . import (
encoding,
error,
@@ -376,6 +380,13 @@
newdirs.append(d)
dirs[:] = newdirs
+def binnode(ctx):
+ """Return binary node id for a given basectx"""
+ node = ctx.node()
+ if node is None:
+ return wdirid
+ return node
+
def intrev(ctx):
"""Return integer for a given basectx that can be used in comparison or
arithmetic operation"""