Mercurial > public > mercurial-scm > hg-stable
diff contrib/perf.py @ 32414:04baab18d60a
commands: move templates of common command options to cmdutil (API)
The goal is to get rid of the debugcommands -> commands dependency.
Since globalopts is the property of the commands, it's kept in the commands
module.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 14 May 2017 16:19:47 +0900 |
parents | 46ba2cdda476 |
children | f90419a90cc3 |
line wrap: on
line diff
--- a/contrib/perf.py Sat Aug 13 12:29:53 2016 +0900 +++ b/contrib/perf.py Sun May 14 16:19:47 2017 +0900 @@ -85,18 +85,20 @@ # available, because commands.formatteropts has been available since # 3.2 (or 7a7eed5176a4), even though formatting itself has been # available since 2.2 (or ae5f92e154d3) -formatteropts = getattr(commands, "formatteropts", []) +formatteropts = getattr(cmdutil, "formatteropts", + getattr(commands, "formatteropts", [])) # for "historical portability": # use locally defined option list, if debugrevlogopts isn't available, # because commands.debugrevlogopts has been available since 3.7 (or # 5606f7d0d063), even though cmdutil.openrevlog() has been available # since 1.9 (or a79fea6b3e77). -revlogopts = getattr(commands, "debugrevlogopts", [ +revlogopts = getattr(cmdutil, "debugrevlogopts", + getattr(commands, "debugrevlogopts", [ ('c', 'changelog', False, ('open changelog')), ('m', 'manifest', False, ('open manifest')), ('', 'dir', False, ('open directory manifest')), - ]) + ])) cmdtable = {}