Patchwork [1,of,3,diffset-extra] revset: use _diffset in lazyset.__sub__

login
register
mail settings
Submitter Gregory Szorc
Date Sept. 8, 2014, 10 p.m.
Message ID <b590210d167f2a0f6445.1410213650@gps-mbp.local>
Download mbox | patch
Permalink /patch/5733/
State Deferred
Headers show

Comments

Gregory Szorc - Sept. 8, 2014, 10 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1410200337 25200
#      Mon Sep 08 11:18:57 2014 -0700
# Node ID b590210d167f2a0f6445f58427d70af7cde96be5
# Parent  d2c3dd725cf9b64b564f13096102f61f6b0d06ba
revset: use _diffset in lazyset.__sub__

On a clone of the Firefox repository with several heads, this change
appeared to have no statistically significant impact on revset
benchmarks. On initial glance, the author() revsets appeared to be
slightly slower. However, subsequent investigation revealed that this
was likely due to insufficient sample size (3 runs due to long
execution time). If run enough times, results are consistent with
before.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2350,9 +2350,9 @@  class lazyset(object):
     def __and__(self, x):
         return lazyset(self, x.__contains__)
 
     def __sub__(self, x):
-        return lazyset(self, lambda r: r not in x)
+        return _diffset(self, x)
 
     def __add__(self, x):
         return _addset(self, x)