Patchwork [4,of,7] devel: use the new 'config' argument for the revset develwarn

login
register
mail settings
Submitter Pierre-Yves David
Date May 5, 2016, 5:05 p.m.
Message ID <d671ff0fad1cabc27f58.1462467954@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/14926/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Pierre-Yves David - May 5, 2016, 5:05 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1462457036 -7200
#      Thu May 05 16:03:56 2016 +0200
# Node ID d671ff0fad1cabc27f586978593ce956d8611e78
# Parent  32b36022d50653b1d73e20905933081f29f88d24
# EXP-Topic develwarn
devel: use the new 'config' argument for the revset develwarn

Patch

diff -r 32b36022d506 -r d671ff0fad1c mercurial/revset.py
--- a/mercurial/revset.py	Thu May 05 18:29:13 2016 +0200
+++ b/mercurial/revset.py	Thu May 05 16:03:56 2016 +0200
@@ -330,13 +330,12 @@  def getset(repo, subset, x):
     s = methods[x[0]](repo, subset, *x[1:])
     if util.safehasattr(s, 'isascending'):
         return s
-    if (repo.ui.configbool('devel', 'all-warnings')
-            or repo.ui.configbool('devel', 'old-revset')):
-        # 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.develwarn('revset "%s" use list instead of smartset, '
-                              '(upgrade your code)' % x[1][1])
+    # 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.develwarn('revset "%s" use list instead of smartset, '
+                          '(upgrade your code)' % x[1][1],
+                          config='old-revset')
     return baseset(s)
 
 def _getrevsource(repo, r):