Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 26143:42bb1812686f
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".
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 01 Sep 2015 16:46:05 -0700 |
parents | 5618858dce26 |
children | 0d8df1f510c6 |
comparison
equal
deleted
inserted
replaced
26142:7332bf4ae959 | 26143:42bb1812686f |
---|---|
2065 try: | 2065 try: |
2066 # fast path for integer revision | 2066 # fast path for integer revision |
2067 r = int(t) | 2067 r = int(t) |
2068 if str(r) != t or r not in cl: | 2068 if str(r) != t or r not in cl: |
2069 raise ValueError | 2069 raise ValueError |
2070 revs = [r] | |
2070 except ValueError: | 2071 except ValueError: |
2071 r = repo[t].rev() | 2072 revs = stringset(repo, subset, t) |
2072 if r in seen: | 2073 |
2073 continue | 2074 for r in revs: |
2074 if (r in subset | 2075 if r in seen: |
2075 or r == node.nullrev and isinstance(subset, fullreposet)): | 2076 continue |
2076 ls.append(r) | 2077 if (r in subset |
2077 seen.add(r) | 2078 or r == node.nullrev and isinstance(subset, fullreposet)): |
2079 ls.append(r) | |
2080 seen.add(r) | |
2078 return baseset(ls) | 2081 return baseset(ls) |
2079 | 2082 |
2080 # for internal use | 2083 # for internal use |
2081 def _intlist(repo, subset, x): | 2084 def _intlist(repo, subset, x): |
2082 s = getstring(x, "internal error") | 2085 s = getstring(x, "internal error") |