revset: fix resolving strings from a list
When using multiple revsets that get optimized into a list (like
hg log -r r1235 -r r1237 in hgsubversion), the revset list code was assuming the
strings were resolvable via repo[X]. hgsubversion and other extensions override
def stringset() to allow processing different revision identifiers (such as
r1235 or g<githash>), and there for the _list() implementation was circumventing
that resolution.
The fix is to just call stringset(). The default implementaiton does the same
thing that _list was already doing (namely repo[X]).
This has always been broken, but it was recently exposed by
4ee4f7415095 which
made "--rev X --rev Y" produce a combined revset "X | Y".
--- a/mercurial/revset.py Mon Aug 31 23:29:15 2015 +0900
+++ b/mercurial/revset.py Tue Sep 01 16:46:05 2015 -0700
@@ -2067,14 +2067,17 @@
r = int(t)
if str(r) != t or r not in cl:
raise ValueError
+ revs = [r]
except ValueError:
- r = repo[t].rev()
- if r in seen:
- continue
- if (r in subset
- or r == node.nullrev and isinstance(subset, fullreposet)):
- ls.append(r)
- seen.add(r)
+ revs = stringset(repo, subset, t)
+
+ for r in revs:
+ if r in seen:
+ continue
+ if (r in subset
+ or r == node.nullrev and isinstance(subset, fullreposet)):
+ ls.append(r)
+ seen.add(r)
return baseset(ls)
# for internal use