context: work around `long` not existing on Python 3
authorAugie Fackler <augie@google.com>
Sat, 11 Mar 2017 20:57:04 -0500
changeset 31343 ff2f90503d64
parent 31342 1470b0f771c8
child 31344 c99371e38e5e
context: work around `long` not existing on Python 3 I can't figure out what this branch is even trying to accomplish, and it was introduced in ac89a23ca814 which doesn't really shed any insight into why longs are treated differently from ints.
mercurial/context.py
--- a/mercurial/context.py	Sat Mar 11 20:53:20 2017 -0500
+++ b/mercurial/context.py	Sat Mar 11 20:57:04 2017 -0500
@@ -33,6 +33,7 @@
     obsolete as obsmod,
     patch,
     phases,
+    pycompat,
     repoview,
     revlog,
     scmutil,
@@ -419,7 +420,7 @@
                 self._node = repo.changelog.node(changeid)
                 self._rev = changeid
                 return
-            if isinstance(changeid, long):
+            if not pycompat.ispy3 and isinstance(changeid, long):
                 changeid = str(changeid)
             if changeid == 'null':
                 self._node = nullid