Patchwork D2557: revset: use %d to turn an int into a bytestr

login
register
mail settings
Submitter phabricator
Date March 2, 2018, 5:11 p.m.
Message ID <differential-rev-PHID-DREV-wsicda3pzwh46x7bs2jg-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28704/
State Superseded
Headers show

Comments

phabricator - March 2, 2018, 5:11 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2557

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2061,7 +2061,7 @@ 
         try:
             # fast path for integer revision
             r = int(t)
-            if str(r) != t or r not in cl:
+            if ('%d' % r) != t or r not in cl:
                 raise ValueError
             revs = [r]
         except ValueError: