##// END OF EJS Templates
devel-warn: issue a warning for old style revsets...
Pierre-Yves David -
r25630:c88082ba default
parent child Browse files
Show More
@@ -321,6 +321,13 b' def getset(repo, subset, x):'
321 s = methods[x[0]](repo, subset, *x[1:])
321 s = methods[x[0]](repo, subset, *x[1:])
322 if util.safehasattr(s, 'isascending'):
322 if util.safehasattr(s, 'isascending'):
323 return s
323 return s
324 if (repo.ui.configbool('devel', 'all-warnings')
325 or repo.ui.configbool('devel', 'old-revset')):
326 # else case should not happen, because all non-func are internal,
327 # ignoring for now.
328 if x[0] == 'func' and x[1][0] == 'symbol' and x[1][1] in symbols:
329 repo.ui.develwarn('revset "%s" use list instead of smartset, '
330 '(upgrade your code)' % x[1][1])
324 return baseset(s)
331 return baseset(s)
325
332
326 def _getrevsource(repo, r):
333 def _getrevsource(repo, r):
@@ -3,7 +3,7 b''
3 > """A small extension that acquire locks in the wrong order
3 > """A small extension that acquire locks in the wrong order
4 > """
4 > """
5 >
5 >
6 > from mercurial import cmdutil, repair
6 > from mercurial import cmdutil, repair, revset
7 >
7 >
8 > cmdtable = {}
8 > cmdtable = {}
9 > command = cmdutil.command(cmdtable)
9 > command = cmdutil.command(cmdtable)
@@ -47,6 +47,11 b''
47 > repair.strip(repo.ui, repo, [repo['.'].node()])
47 > repair.strip(repo.ui, repo, [repo['.'].node()])
48 > finally:
48 > finally:
49 > lo.release()
49 > lo.release()
50 >
51 > def oldstylerevset(repo, subset, x):
52 > return list(subset)
53 >
54 > revset.symbols['oldstyle'] = oldstylerevset
50 > EOF
55 > EOF
51
56
52 $ cat << EOF >> $HGRCPATH
57 $ cat << EOF >> $HGRCPATH
@@ -106,4 +111,8 b''
106 (contact your extension maintainer)
111 (contact your extension maintainer)
107 [255]
112 [255]
108
113
114 $ hg log -r "oldstyle()" -T '{rev}\n'
115 devel-warn: revset "oldstyle" use list instead of smartset, (upgrade your code) at: */mercurial/revset.py:* (mfunc) (glob)
116 0
117
109 $ cd ..
118 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now