Mercurial > hg
comparison tests/test-encoding-align.t @ 32337:46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
cmdutil.command wasn't a member of the registrar framework only for a
historical reason. Let's make that happen. This patch keeps cmdutil.command
as an alias for extension compatibility.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 09 Jan 2016 23:07:20 +0900 |
parents | 701df761aa94 |
children | fce4ed2912bb |
comparison
equal
deleted
inserted
replaced
32336:ff874d34c856 | 32337:46ba2cdda476 |
---|---|
14 > f = file('s', 'w'); f.write(s); f.close() | 14 > f = file('s', 'w'); f.write(s); f.close() |
15 > f = file('m', 'w'); f.write(m); f.close() | 15 > f = file('m', 'w'); f.write(m); f.close() |
16 > f = file('l', 'w'); f.write(l); f.close() | 16 > f = file('l', 'w'); f.write(l); f.close() |
17 > # instant extension to show list of options | 17 > # instant extension to show list of options |
18 > f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8 | 18 > f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8 |
19 > from mercurial import cmdutil | 19 > from mercurial import registrar |
20 > cmdtable = {} | 20 > cmdtable = {} |
21 > command = cmdutil.command(cmdtable) | 21 > command = registrar.command(cmdtable) |
22 > | 22 > |
23 > @command('showoptlist', | 23 > @command('showoptlist', |
24 > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'), | 24 > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'), |
25 > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'), | 25 > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'), |
26 > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s')], | 26 > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s')], |