Mercurial > hg
changeset 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 | 7332bf4ae959 |
children | 4bc3707f3e67 |
files | mercurial/revset.py |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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