changeset 31809:35b8bb1ef02b

revset: stop supporting predicate that returns plain list (API) It's said to be removed after 3.9.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 02 Apr 2017 22:01:32 +0900
parents ca3b4a2b7e54
children 81abd0d12c86
files mercurial/revset.py tests/test-devel-warnings.t
diffstat 2 files changed, 4 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Sat Apr 01 12:24:59 2017 +0200
+++ b/mercurial/revset.py	Sun Apr 02 22:01:32 2017 +0900
@@ -169,16 +169,7 @@
 def getset(repo, subset, x):
     if not x:
         raise error.ParseError(_("missing argument"))
-    s = methods[x[0]](repo, subset, *x[1:])
-    if util.safehasattr(s, 'isascending'):
-        return s
-    # else case should not happen, because all non-func are internal,
-    # ignoring for now.
-    if x[0] == 'func' and x[1][0] == 'symbol' and x[1][1] in symbols:
-        repo.ui.deprecwarn('revset "%s" uses list instead of smartset'
-                           % x[1][1],
-                           '3.9')
-    return baseset(s)
+    return methods[x[0]](repo, subset, *x[1:])
 
 def _getrevsource(repo, r):
     extra = repo[r].extra()
--- a/tests/test-devel-warnings.t	Sat Apr 01 12:24:59 2017 +0200
+++ b/tests/test-devel-warnings.t	Sun Apr 02 22:01:32 2017 +0900
@@ -3,7 +3,7 @@
   > """A small extension that tests our developer warnings
   > """
   > 
-  > from mercurial import cmdutil, repair, revset
+  > from mercurial import cmdutil, repair
   > 
   > cmdtable = {}
   > command = cmdutil.command(cmdtable)
@@ -58,11 +58,6 @@
   >     def foobar(ui):
   >         ui.deprecwarn('foorbar is deprecated, go shopping', '42.1337')
   >     foobar(ui)
-  > 
-  > def oldstylerevset(repo, subset, x):
-  >     return list(subset)
-  > 
-  > revset.symbols['oldstyle'] = oldstylerevset
   > EOF
 
   $ cat << EOF >> $HGRCPATH
@@ -111,10 +106,6 @@
   Traceback (most recent call last):
   mercurial.error.ProgrammingError: cannot strip from inside a transaction
 
-  $ hg log -r "oldstyle()" -T '{rev}\n'
-  devel-warn: revset "oldstyle" uses list instead of smartset
-  (compatibility will be dropped after Mercurial-3.9, update your code.) at: *mercurial/revset.py:* (mfunc) (glob)
-  0
   $ hg oldanddeprecated
   devel-warn: foorbar is deprecated, go shopping
   (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
@@ -135,10 +126,7 @@
    */mercurial/dispatch.py:* in <lambda> (glob)
    */mercurial/util.py:* in check (glob)
    $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
-  $ hg blackbox -l 9
-  1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: revset "oldstyle" uses list instead of smartset
-  (compatibility will be dropped after Mercurial-3.9, update your code.) at: *mercurial/revset.py:* (mfunc) (glob)
-  1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> log -r *oldstyle()* -T *{rev}\n* exited 0 after * seconds (glob)
+  $ hg blackbox -l 7
   1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
   1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
   (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
@@ -160,7 +148,7 @@
    */mercurial/util.py:* in check (glob)
    $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
   1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
-  1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 9
+  1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
 
 Test programming error failure: