Patchwork [4,of,6] revset: drop redundant filteredset from right-hand side set of "or" operation

login
register
mail settings
Submitter Yuya Nishihara
Date May 12, 2015, 10:59 p.m.
Message ID <1ef1b51bba52a6d186fd.1431471578@mimosa>
Download mbox | patch
Permalink /patch/9033/
State Superseded
Commit 40a2cf1c765bf6e10e150b9b6cdaeec6acf7eb26
Headers show

Comments

Yuya Nishihara - May 12, 2015, 10:59 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1427716597 -32400
#      Mon Mar 30 20:56:37 2015 +0900
# Node ID 1ef1b51bba52a6d186fdbc794045eec6b6477be0
# Parent  cc7253d43150ef937aca205f2cb66a569378aeea
revset: drop redundant filteredset from right-hand side set of "or" operation

It should no longer be necessary because the addset can remove duplicates
correctly.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -360,7 +360,7 @@  def andset(repo, subset, x, y):
 
 def orset(repo, subset, x, y):
     xl = getset(repo, subset, x)
-    yl = getset(repo, subset - xl, y)
+    yl = getset(repo, subset, y)
     return xl + yl
 
 def notset(repo, subset, x):
diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -848,9 +848,7 @@  test that `or` operation skips duplicate
   * set:
   <addset
     <baseset [5, 3, 1]>,
-    <filteredset
-      <filteredset
-        <fullreposet+ 0:9>>>>
+    <generatorset+>>
   5
   3
   1
@@ -872,8 +870,7 @@  test that `or` operation skips duplicate
   * set:
   <addset+
     <generatorset+>,
-    <filteredset
-      <baseset [5, 3, 1]>>>
+    <baseset [5, 3, 1]>>
   0
   1
   2
@@ -1391,8 +1388,7 @@  far away.
   <addset
     <baseset [9]>,
     <filteredset
-      <filteredset
-        <fullreposet+ 0:9>>>>
+      <fullreposet+ 0:9>>>
   9
 
   $ try 'd(2:5)'