Patchwork [2,of,2] devel-warn: issue a warning for old style revsets

login
register
mail settings
Submitter Pierre-Yves David
Date June 19, 2015, 6:41 p.m.
Message ID <13887cc1647ef5a2f39f.1434739270@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9716/
State Superseded
Headers show

Comments

Pierre-Yves David - June 19, 2015, 6:41 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1434737831 25200
#      Fri Jun 19 11:17:11 2015 -0700
# Node ID 13887cc1647ef5a2f39f3ae447fba4961499fa98
# Parent  a51f19e7f84edf50d1d751d8f55466bb10f4ba05
devel-warn: issue a warning for old style revsets

We have move to smartset class more than a year ago, we now have the tool to
aggressively nudge developer into upgrading their extensions.
Pierre-Yves David - June 19, 2015, 6:48 p.m.
On 06/19/2015 11:41 AM, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1434737831 25200
> #      Fri Jun 19 11:17:11 2015 -0700
> # Node ID 13887cc1647ef5a2f39f3ae447fba4961499fa98
> # Parent  a51f19e7f84edf50d1d751d8f55466bb10f4ba05
> devel-warn: issue a warning for old style revsets

I forgot to amend something, please disregard this series.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -319,10 +319,14 @@  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
+    if (repo.ui.configbool('devel', 'all-warnings')
+            or repo.ui.configbool('devel', 'old-revset')):
+        repo.ui.develwarn('revset use list instead of smartset, '
+                          '(upgrade your code)')
     return baseset(s)
 
 def _getrevsource(repo, r):
     extra = repo[r].extra()
     for label in ('source', 'transplant_source', 'rebase_source'):