Mercurial > hg-stable
changeset 20551:efae655fd363
scmutil: changed revrange to return lazysets for new style revsets
When there is an old style revset or both it will still return a baseset. This
may be changed in later patches.
author | Lucas Moscovicz <lmoscovicz@fb.com> |
---|---|
date | Wed, 12 Feb 2014 15:30:27 -0800 |
parents | 1716a2671ec7 |
children | 0e99a66eb7bc |
files | mercurial/scmutil.py |
diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/scmutil.py Thu Feb 20 02:43:17 2014 +0100 +++ b/mercurial/scmutil.py Wed Feb 12 15:30:27 2014 -0800 @@ -499,7 +499,7 @@ try: if isinstance(spec, int): seen.add(spec) - l.append(spec) + l = l + [spec] continue if _revrangesep in spec: @@ -520,7 +520,7 @@ seen.update(newrevs) else: seen = newrevs - l.extend(sorted(newrevs, reverse=start > end)) + l = l + sorted(newrevs, reverse=start > end) continue elif spec and spec in repo: # single unquoted rev rev = revfix(repo, spec, None) @@ -534,11 +534,14 @@ # fall through to new-style queries if old-style fails m = revset.match(repo.ui, spec) - dl = [r for r in m(repo, revset.spanset(repo)) if r not in seen] - l.extend(dl) - seen.update(dl) + if seen or l: + dl = [r for r in m(repo, revset.spanset(repo)) if r not in seen] + l = l + dl + seen.update(dl) + else: + l = m(repo, revset.spanset(repo)) - return revset.baseset(l) + return l def expandpats(pats): if not util.expandglobs: