Milan Stanojevi reported to the user mailing list: In my repository, I tried hg log -r 'ancestor(tip,rev) and rev' where rev is ancestor of tip and got the following exception ** unknown exception encountered, details follow ** report bug details to http://mercurial.selenic.com/bts/ ** or mercurial@selenic.com ** Python 2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] ** Mercurial Distributed SCM (version 1.6) ** Extensions loaded: extdiff, fetch, graphlog, graphviz, hgk, mq, purge, record, transplant Traceback (most recent call last): File "/home/mstanojevic/local/mercurial-1.6/hg", line 27, in ? mercurial.dispatch.run() File "mercurial/dispatch.py", line 16, in run File "mercurial/dispatch.py", line 34, in dispatch File "mercurial/dispatch.py", line 54, in _runcatch File "mercurial/dispatch.py", line 483, in _dispatch File "mercurial/dispatch.py", line 351, in runcommand File "mercurial/dispatch.py", line 534, in _runcommand File "mercurial/dispatch.py", line 488, in checkargs File "mercurial/dispatch.py", line 481, in <lambda> File "mercurial/util.py", line 420, in check File "mercurial/extensions.py", line 115, in wrap File "mercurial/util.py", line 420, in check File "hgext/mq.py", line 2791, in mqcommand File "mercurial/util.py", line 420, in check File "mercurial/extensions.py", line 115, in wrap File "mercurial/util.py", line 420, in check File "hgext/graphlog.py", line 368, in graph File "mercurial/util.py", line 420, in check File "/usr/lib64/python2.4/commands.py", line 2526, in log File "mercurial/cmdutil.py", line 1040, in walkchangerevs File "mercurial/cmdutil.py", line 178, in revrange File "mercurial/revset.py", line 568, in mfunc File "mercurial/revset.py", line 110, in getset File "mercurial/revset.py", line 148, in andset File "mercurial/revset.py", line 110, in getset File "mercurial/revset.py", line 164, in func File "mercurial/revset.py", line 230, in ancestor IndexError: list index out of range Command exited with non-zero status 1 hg log -r 'ancestor(tip,rev) or rev' works just fine Hopefully you can figure out what is wrong. Btw, I really like the revsets feature. Thanks
In the ancestor function in revset.py, when a = getset(repo, subset, l[0]) is done, the 'a' variable gets an empty list. As Milan already pointed out, leaving the 'and' out doesn't trigger this bug, like in hg log -r 'ancestor(tip,1.6)'
Running it without quotes works quite fine, btw. hg log -r ancestor(tip,1.6) and 1.6
Without quotes is a different beast entirely. 'and' and '1.6' will be treated as filenames. Fix in stable.
For historical purposes, fix is in changeset http://selenic.com/repo/hg/rev/ebaf117c2642 and also marked the bug as resolved.
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:11 EDT --- This bug was previously known as _bug_ 2298 at http://mercurial.selenic.com/bts/issue2298