[Bug 4568] New: paths in revset in hgweb searches aren't normalized properly, leads to "Abort: X not under root" errors
mercurial-bugs at selenic.com
mercurial-bugs at selenic.com
Mon Mar 16 19:56:57 UTC 2015
http://bz.selenic.com/show_bug.cgi?id=4568
Priority: normal
Bug ID: 4568
CC: mercurial-devel at selenic.com
Assignee: bugzilla at selenic.com
Summary: paths in revset in hgweb searches aren't normalized
properly, leads to "Abort: X not under root" errors
Severity: bug
Classification: Unclassified
OS: All
Reporter: gregory.szorc at gmail.com
Hardware: All
Status: UNCONFIRMED
Version: 3.3.2
Component: hgweb
Product: Mercurial
We're running hgweb in directory mode on hg.mozilla.org. If you go to
https://hg.mozilla.org/mozilla-central/ and enter a search like "adds(mach)",
you get an abort due to path normalization:
mod_wsgi (pid=24196): Exception occurred processing WSGI script
'/repo_local/mozilla/webroot_wsgi/hgweb.wsgi'.
Traceback (most recent call last):
File "/repo_local/mozilla/extensions/serverlog/__init__.py", line 285, in
run_wsgi
for what in super(hgwebwrapped, self).run_wsgi(req):
File "/usr/lib64/python2.6/site-packages/mercurial/util.py", line 532, in
increasingchunks
for chunk in source:
File "/usr/lib64/python2.6/site-packages/mercurial/templater.py", line 578,
in _flatten
for j in _flatten(i):
File "/usr/lib64/python2.6/site-packages/mercurial/templater.py", line 571,
in _flatten
for i in thing:
File "/usr/lib64/python2.6/site-packages/mercurial/hgweb/webcommands.py",
line 202, in changelist
for ctx in searchfunc[0](funcarg):
File "/usr/lib64/python2.6/site-packages/mercurial/hgweb/webcommands.py",
line 150, in revsetsearch
for r in revs:
File "/usr/lib64/python2.6/site-packages/mercurial/revset.py", line 2750, in
_iterfilter
if cond(x):
File "/usr/lib64/python2.6/site-packages/mercurial/util.py", line 324, in f
cache[arg] = func(arg)
File "/usr/lib64/python2.6/site-packages/mercurial/revset.py", line 584, in
matches
mcache[0] = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c)
File "/usr/lib64/python2.6/site-packages/mercurial/match.py", line 86, in
__init__
kindpats = _normalize(patterns, default, root, cwd, auditor)
File "/usr/lib64/python2.6/site-packages/mercurial/match.py", line 379, in
_normalize
pat = pathutil.canonpath(root, cwd, pat, auditor)
File "/usr/lib64/python2.6/site-packages/mercurial/pathutil.py", line 155, in
canonpath
raise util.Abort(_("%s not under root '%s'") % (myname, root))
Abort: mach not under root '/repo_local/mozilla/mozilla/mozilla-central'
Things work fine normally in single repo hosting mode.
A workaround is to prefix values with "path:". But "adds(mach)" works fine on
the CLI. It should work the same in hgweb.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Mercurial-devel
mailing list