comparison mercurial/utils/storageutil.py @ 40321:6994a8be3663

storageutil: convert fileid to bytes to avoid cast to %s test-storage.py manages to trigger this on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5117
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 16 Oct 2018 17:45:39 +0200
parents f5d819d84461
children b0fbd1792e2d
comparison
equal deleted inserted replaced
40320:9b2e1b00ee94 40321:6994a8be3663
180 """ 180 """
181 if isinstance(fileid, int): 181 if isinstance(fileid, int):
182 try: 182 try:
183 return store.node(fileid) 183 return store.node(fileid)
184 except IndexError: 184 except IndexError:
185 raise error.LookupError(fileid, identifier, _('no match found')) 185 raise error.LookupError('%d' % fileid, identifier,
186 _('no match found'))
186 187
187 if len(fileid) == 20: 188 if len(fileid) == 20:
188 try: 189 try:
189 store.rev(fileid) 190 store.rev(fileid)
190 return fileid 191 return fileid