context: use portable construction to verify int parsing
authorAugie Fackler <augie@google.com>
Sun, 12 Mar 2017 00:43:47 -0500
changeset 31351 5da0c7888dc4
parent 31350 2eee8ad77726
child 31352 667e88568087
context: use portable construction to verify int parsing
mercurial/context.py
--- a/mercurial/context.py	Sun Mar 12 01:59:23 2017 -0500
+++ b/mercurial/context.py	Sun Mar 12 00:43:47 2017 -0500
@@ -454,7 +454,7 @@
 
             try:
                 r = int(changeid)
-                if str(r) != changeid:
+                if '%d' % r != changeid:
                     raise ValueError
                 l = len(repo.changelog)
                 if r < 0: