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

login
register
mail settings
Submitter Yuya Nishihara
Date May 17, 2015, 10:59 p.m.
Message ID <b30196956327136b7ae0.1431903584@mimosa>
Download mbox | patch
Permalink /patch/9120/
State Accepted
Headers show

Comments

Yuya Nishihara - May 17, 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 b30196956327136b7ae08c29bb4819671ceea897
# Parent  e632a2429982fca1251ef65099bdd3668fa4f58a
revset: drop redundant filteredset from right-hand side set of "or" operation

Since 5548f558db3d, it should no longer be necessary because the addset can
remove duplicates correctly.
Matt Mackall - May 18, 2015, 3:06 p.m.
On Mon, 2015-05-18 at 07:59 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1427716597 -32400
> #      Mon Mar 30 20:56:37 2015 +0900
> # Node ID b30196956327136b7ae08c29bb4819671ceea897
> # Parent  e632a2429982fca1251ef65099bdd3668fa4f58a
> revset: drop redundant filteredset from right-hand side set of "or" operation

Queued for default, thanks.

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
@@ -889,9 +889,7 @@  test that `or` operation skips duplicate
   * set:
   <addset
     <baseset [5, 3, 1]>,
-    <filteredset
-      <filteredset
-        <fullreposet+ 0:9>>>>
+    <generatorset+>>
   5
   3
   1
@@ -913,8 +911,7 @@  test that `or` operation skips duplicate
   * set:
   <addset+
     <generatorset+>,
-    <filteredset
-      <baseset [5, 3, 1]>>>
+    <baseset [5, 3, 1]>>
   0
   1
   2
@@ -1432,8 +1429,7 @@  far away.
   <addset
     <baseset [9]>,
     <filteredset
-      <filteredset
-        <fullreposet+ 0:9>>>>
+      <fullreposet+ 0:9>>>
   9
 
   $ try 'd(2:5)'