Commit bd3231ec authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

upgrade: avoid a traceback in case of unrecognized revlog

Without this, in case of revlog name not matching any know pattern we would get
a traceback. Raising a clear error seems simpler.

Differential Revision: https://phab.mercurial-scm.org/D11202
parent afc461cde67a
Pipeline #24979 passed with stages
in 76 minutes and 43 seconds
......@@ -64,7 +64,12 @@ def _revlogfrompath(repo, rl_type, path):
)
else:
# drop the extension and the `data/` prefix
path = path.rsplit(b'.', 1)[0].split(b'/', 1)[1]
path_part = path.rsplit(b'.', 1)[0].split(b'/', 1)
if len(path_part) < 2:
msg = _('cannot recognize revlog from filename: %s')
msg %= path
raise error.Abort(msg)
path = path_part[1]
return filelog.filelog(repo.svfs, path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment