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

Yuya Nishihara yuya at tcha.org
Mon Jun 1 10:21:05 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at 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.

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)
 


More information about the Mercurial-devel mailing list