# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 2017-03-12 05:43:47
# Node ID 5da0c7888dc41e853b15c7a06b10a7fdd92f499c
# Parent  2eee8ad777263d57941eeb38d1585861b9b6bd6f

context: use portable construction to verify int parsing

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -454,7 +454,7 @@ class changectx(basectx):
 
             try:
                 r = int(changeid)
-                if str(r) != changeid:
+                if '%d' % r != changeid:
                     raise ValueError
                 l = len(repo.changelog)
                 if r < 0: