From patchwork Mon Sep 8 22:00:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,3,diffset-extra] revset: use _diffset in lazyset.__sub__ From: Gregory Szorc X-Patchwork-Id: 5733 Message-Id: To: mercurial-devel@selenic.com Date: Mon, 08 Sep 2014 15:00:50 -0700 # HG changeset patch # User Gregory Szorc # 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. 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)