diff -r 0e8836be9541 -r ad8389ecd3f5 mercurial/utils/storageutil.py --- a/mercurial/utils/storageutil.py Fri Sep 28 11:03:17 2018 -0700 +++ b/mercurial/utils/storageutil.py Fri Sep 28 11:16:44 2018 -0700 @@ -121,7 +121,10 @@ Raises ``error.LookupError`` on failure. """ if isinstance(fileid, int): - return store.node(fileid) + try: + return store.node(fileid) + except IndexError: + raise error.LookupError(fileid, identifier, _('no match found')) if len(fileid) == 20: try: