diff --git a/mercurial/revset.py b/mercurial/revset.py index 52e5f68d8363d634e89325cf5c21506c0b031159_bWVyY3VyaWFsL3JldnNldC5weQ==..c88082baf6933dbde3f6bdde6fff788defa06ec6_bWVyY3VyaWFsL3JldnNldC5weQ== 100644 --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -321,6 +321,13 @@ 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]) return baseset(s) def _getrevsource(repo, r): diff --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t index 52e5f68d8363d634e89325cf5c21506c0b031159_dGVzdHMvdGVzdC1kZXZlbC13YXJuaW5ncy50..c88082baf6933dbde3f6bdde6fff788defa06ec6_dGVzdHMvdGVzdC1kZXZlbC13YXJuaW5ncy50 100644 --- a/tests/test-devel-warnings.t +++ b/tests/test-devel-warnings.t @@ -3,7 +3,7 @@ > """A small extension that acquire locks in the wrong order > """ > - > from mercurial import cmdutil, repair + > from mercurial import cmdutil, repair, revset > > cmdtable = {} > command = cmdutil.command(cmdtable) @@ -47,6 +47,11 @@ > repair.strip(repo.ui, repo, [repo['.'].node()]) > finally: > lo.release() + > + > def oldstylerevset(repo, subset, x): + > return list(subset) + > + > revset.symbols['oldstyle'] = oldstylerevset > EOF $ cat << EOF >> $HGRCPATH @@ -106,4 +111,8 @@ (contact your extension maintainer) [255] + $ hg log -r "oldstyle()" -T '{rev}\n' + devel-warn: revset "oldstyle" use list instead of smartset, (upgrade your code) at: */mercurial/revset.py:* (mfunc) (glob) + 0 + $ cd ..