From patchwork Fri Jan 30 14:08:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 2, STABLE] revset: add test of compatibility layer introduced in bde426f18e0a From: Yuya Nishihara X-Patchwork-Id: 7576 Message-Id: <03b6a2472e4e713f62e9.1422626881@mimosa> To: mercurial-devel@selenic.com Date: Fri, 30 Jan 2015 23:08:01 +0900 # HG changeset patch # User Yuya Nishihara # Date 1422622680 -32400 # Fri Jan 30 21:58:00 2015 +0900 # Branch stable # Node ID 03b6a2472e4e713f62e91549ee166c04e547adb2 # Parent 6becb9dbca25057c6186e255a48dd2c2ce5701a5 revset: add test of compatibility layer introduced in bde426f18e0a diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -1269,3 +1269,30 @@ test in problematic encoding 3 $ cd .. + +compatibility layer for old extension that does not know smartset + + $ cat < lset.py + > from mercurial import cmdutil, revset + > cmdtable = {} + > command = cmdutil.command(cmdtable) + > @command('matchlist') + > def matchlist(ui, repo, expr): + > mf = revset.match(ui, expr) + > for c in mf(repo, range(len(repo))): + > ui.write('%s\n' % c) + > def aslist(repo, subset, x): + > revset.getargs(x, 0, 0, 'aslist takes no argument') + > return list(subset) + > def uisetup(ui): + > revset.symbols['aslist'] = aslist + > EOF + + $ cd repo + + $ hg --config extensions.lset=../lset.py matchlist 'p1()' + 9 + $ hg --config extensions.lset=../lset.py debugrevspec 'min(aslist())' + 0 + + $ cd ..