Patchwork [2,of,4] revrange: clean up meaningless reconstruction of sets

login
register
mail settings
Submitter Yuya Nishihara
Date June 1, 2015, 3:21 p.m.
Message ID <da102f9b19e6bd1a6143.1433172065@mimosa>
Download mbox | patch
Permalink /patch/9421/
State Accepted
Headers show

Comments

Yuya Nishihara - June 1, 2015, 3:21 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1432457995 -32400
#      Sun May 24 17:59:55 2015 +0900
# Node ID da102f9b19e6bd1a6143e070cc5152c6d00ea4da
# Parent  bbd7b058bb0fc3bd5c1159717c579dfa0fc87a53
revrange: clean up meaningless reconstruction of sets

They just exist for deduplication that was removed by the previous patch.

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -742,8 +742,7 @@  def revrange(repo, revs):
                     # by far the most common case: revs = ["-1:0"]
                     l = revset.baseset(rangeiter)
                     continue
-                newrevs = set(rangeiter)
-                l = l + revset.baseset(sorted(newrevs, reverse=start > end))
+                l = l + revset.baseset(rangeiter)
                 continue
             elif spec and spec in repo: # single unquoted rev
                 rev = revfix(repo, spec, None)
@@ -755,8 +754,7 @@  def revrange(repo, revs):
         # fall through to new-style queries if old-style fails
         m = revset.match(repo.ui, spec, repo)
         if l:
-            dl = [r for r in m(repo)]
-            l = l + revset.baseset(dl)
+            l = l + m(repo)
         else:
             l = m(repo)