Some space characters accidentally escaped my revset and got me a traceback, here reproduced in the current default branch with default config: hg$ HGPLAIN= HOME=/tmp ./hg log -r tip % . obsolete feature not enabled but 242956 markers found! ** unknown exception encountered, please report by visiting ** https://mercurial-scm.org/wiki/BugTracker ** Python 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0] ** Mercurial Distributed SCM (version 5.7rc0+79-16c18d5e5dc8) ** Extensions loaded: Traceback (most recent call last): File "./hg", line 59, in <module> dispatch.run() File "/home/zash/src/hg/mercurial/dispatch.py", line 143, in run status = dispatch(req) File "/home/zash/src/hg/mercurial/dispatch.py", line 245, in dispatch status = _rundispatch(req) File "/home/zash/src/hg/mercurial/dispatch.py", line 289, in _rundispatch ret = _runcatch(req) or 0 File "/home/zash/src/hg/mercurial/dispatch.py", line 465, in _runcatch return _callcatch(ui, _runcatchfunc) File "/home/zash/src/hg/mercurial/dispatch.py", line 475, in _callcatch return scmutil.callcatch(ui, func) File "/home/zash/src/hg/mercurial/scmutil.py", line 155, in callcatch return func() File "/home/zash/src/hg/mercurial/dispatch.py", line 455, in _runcatchfunc return _dispatch(req) File "/home/zash/src/hg/mercurial/dispatch.py", line 1259, in _dispatch lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions File "/home/zash/src/hg/mercurial/dispatch.py", line 913, in runcommand ret = _runcommand(ui, options, cmd, d) File "/home/zash/src/hg/mercurial/dispatch.py", line 1270, in _runcommand return cmdfunc() File "/home/zash/src/hg/mercurial/dispatch.py", line 1256, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) File "/home/zash/src/hg/mercurial/util.py", line 1867, in check return func(*args, **kwargs) File "/home/zash/src/hg/mercurial/commands.py", line 4653, in log revs, differ = logcmdutil.getrevs(repo, walk_opts) File "/home/zash/src/hg/mercurial/logcmdutil.py", line 1028, in getrevs revs, filematcher = makewalker(repo, wopts) File "/home/zash/src/hg/mercurial/logcmdutil.py", line 982, in makewalker match, pats, slowpath = _makematcher(repo, revs, wopts) File "/home/zash/src/hg/mercurial/logcmdutil.py", line 836, in _makematcher filelog = repo.file(f) File "/home/zash/src/hg/mercurial/localrepo.py", line 1138, in file if path[0] == b'/': IndexError: index out of range It seems to happen when two arguments are given, one existing path and one non-existing. E.g. `hg log existingfile nonexistantfile`.
Bug was set to IN_PROGRESS for 14 days, moving back to confirmed
https://patchwork.mercurial-scm.org/patch/48258/
Fixed by https://mercurial-scm.org/repo/hg/rev/9842c00f0252 Yuya Nishihara <yuya@tcha.org> log: fix handling of root (or empty) path provided by matcher (issue6478) Since 27d6956d386b "match: use '' instead of '.' for root directory", '.' should be translated to ''. We can't blame repo.file() about this because an empty string is invalid as a file path, but I found at least two callers (_makematcher() and revset.filelog()) would crash because of this path[0]. So let's make repo.file() accept an empty string. path[0] == b'/' wouldn't work on Python 3 anyways. (please test the fix)
hg$ hg pull -r 9842c00f0252 && hg up -r 9842c00f0252 hg$ make local hg$ hg log -l 5 hg . ... ** Mercurial Distributed SCM (version 5.7) ... IndexError: index out of range hg$ ./hg log -l 5 hg . changeset: 46691:9842c00f0252 ... Fix seems to work.
Bug was set to TESTING for 8 days, resolving