Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 36721:981f328d6d16
py3: use b"%d" instead of str() to convert integers to bytes
Differential Revision: https://phab.mercurial-scm.org/D2664
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 05 Mar 2018 01:05:54 +0530 |
parents | f659a407e5ee |
children | 6bacb2f663cb |
comparison
equal
deleted
inserted
replaced
36720:3fdba7fb264d | 36721:981f328d6d16 |
---|---|
1365 except LookupError: | 1365 except LookupError: |
1366 pass # may be partial hex id | 1366 pass # may be partial hex id |
1367 try: | 1367 try: |
1368 # str(rev) | 1368 # str(rev) |
1369 rev = int(id) | 1369 rev = int(id) |
1370 if str(rev) != id: | 1370 if "%d" % rev != id: |
1371 raise ValueError | 1371 raise ValueError |
1372 if rev < 0: | 1372 if rev < 0: |
1373 rev = len(self) + rev | 1373 rev = len(self) + rev |
1374 if rev < 0 or rev >= len(self): | 1374 if rev < 0 or rev >= len(self): |
1375 raise ValueError | 1375 raise ValueError |