comparison hgext/gpg.py @ 32375: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 b0c42fec8dc2
comparison
equal deleted inserted replaced
32374:194b0f781132 32375:04baab18d60a
12 import tempfile 12 import tempfile
13 13
14 from mercurial.i18n import _ 14 from mercurial.i18n import _
15 from mercurial import ( 15 from mercurial import (
16 cmdutil, 16 cmdutil,
17 commands,
18 error, 17 error,
19 match, 18 match,
20 node as hgnode, 19 node as hgnode,
21 pycompat, 20 pycompat,
22 registrar, 21 registrar,
220 ('k', 'key', '', 219 ('k', 'key', '',
221 _('the key id to sign with'), _('ID')), 220 _('the key id to sign with'), _('ID')),
222 ('m', 'message', '', 221 ('m', 'message', '',
223 _('use text as commit message'), _('TEXT')), 222 _('use text as commit message'), _('TEXT')),
224 ('e', 'edit', False, _('invoke editor on commit messages')), 223 ('e', 'edit', False, _('invoke editor on commit messages')),
225 ] + commands.commitopts2, 224 ] + cmdutil.commitopts2,
226 _('hg sign [OPTION]... [REV]...')) 225 _('hg sign [OPTION]... [REV]...'))
227 def sign(ui, repo, *revs, **opts): 226 def sign(ui, repo, *revs, **opts):
228 """add a signature for the current or given revision 227 """add a signature for the current or given revision
229 228
230 If no revision is given, the parent of the working directory is used, 229 If no revision is given, the parent of the working directory is used,