Patchwork [FOLLOW-UP] revset: transparently forward _intlist argument in all case

login
register
mail settings
Submitter Boris Feld
Date Jan. 15, 2019, 7:43 p.m.
Message ID <7c8a8c0ea0c4cd1c1cbd.1547581419@localhost.localdomain>
Download mbox | patch
Permalink /patch/37764/
State Accepted
Headers show

Comments

Boris Feld - Jan. 15, 2019, 7:43 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1547580257 -3600
#      Tue Jan 15 20:24:17 2019 +0100
# Node ID 7c8a8c0ea0c4cd1c1cbd0fb96342a45e9437d939
# Parent  32ef47b3c91c2913ab13cabf9efcdde3ef137987
# EXP-Topic revs-efficiency
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 7c8a8c0ea0c4
revset: transparently forward _intlist argument in all case

We took a safe approach for the first take, we can get bolder now.
Augie Fackler - Jan. 16, 2019, 9:29 a.m.
On Tue, Jan 15, 2019 at 08:43:39PM +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1547580257 -3600
> #      Tue Jan 15 20:24:17 2019 +0100
> # Node ID 7c8a8c0ea0c4cd1c1cbd0fb96342a45e9437d939
> # Parent  32ef47b3c91c2913ab13cabf9efcdde3ef137987
> # EXP-Topic revs-efficiency
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 7c8a8c0ea0c4
> revset: transparently forward _intlist argument in all case

queued, thanks

Patch

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -757,19 +757,12 @@  def _parseargs(expr, args):
             except IndexError:
                 raise error.ParseError(_('incomplete revspec format character'))
             if islist and d == 'd' and arg:
-                # special case, we might be able to speedup the list of int case
-                #
-                # We have been very conservative here for the first version.
-                # Other types (eg: generator) are probably fine, but we did not
-                # wanted to take any risk>
-                safeinputtype = (list, tuple, set, smartset.abstractsmartset)
-                if isinstance(arg, safeinputtype):
-                    # we don't create a baseset yet, because it come with an
-                    # extra cost. If we are going to serialize it we better
-                    # skip it.
-                    ret.append(('baseset', arg))
-                    pos += 1
-                    continue
+                # we don't create a baseset yet, because it come with an
+                # extra cost. If we are going to serialize it we better
+                # skip it.
+                ret.append(('baseset', arg))
+                pos += 1
+                continue
             try:
                 ret.append((None, f(list(arg), d)))
             except (TypeError, ValueError):