comparison allpaths.py @ 7:1ea915867337

Standard push options are imported from mercurial, not copied here. Functional effect it is now possible to specify: --ssh, --remotecmd, and --insecure which were not handled previously. Extension will also handle new push opts in future (would they happen)
author Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl>
date Sun, 08 Nov 2015 08:45:26 +0100
parents b1d440f1027a
children eced61373a74
comparison
equal deleted inserted replaced
6:b1d440f1027a 7:1ea915867337
5 5
6 '''execute commands on multiple paths''' 6 '''execute commands on multiple paths'''
7 7
8 import mercurial.util 8 import mercurial.util
9 import mercurial.commands 9 import mercurial.commands
10 import mercurial.cmdutil
10 from mercurial.i18n import _ 11 from mercurial.i18n import _
11 12
12 #pylint:disable=invalid-name,broad-except,line-too-long 13 #pylint:disable=invalid-name,broad-except,line-too-long
13
14 14
15 def pushall(ui, repo, **opts): 15 def pushall(ui, repo, **opts):
16 """execute a push command on multiple paths""" 16 """execute a push command on multiple paths"""
17 # Extract our options and filter them out 17 # Extract our options and filter them out
18 group = opts.pop('group', None) 18 group = opts.pop('group', None)
31 if not ignore_errors: 31 if not ignore_errors:
32 raise 32 raise
33 ui.warn(_('error pushing to %s: %s') % (path[1], e)) 33 ui.warn(_('error pushing to %s: %s') % (path[1], e))
34 34
35 35
36 def _original_options(cmdname):
37 """Gets list of given command options as specified in Mercurial core"""
38 _, spec = mercurial.cmdutil.findcmd(cmdname, mercurial.commands.table)
39 return spec[1]
40
41
36 cmdtable = { 42 cmdtable = {
37 "pushall": ( 43 "pushall": (
38 pushall, 44 pushall,
39 [ 45 [
40 ('g', 'group', 'paths', _('use a named group of paths')), 46 ('g', 'group', 'paths', _('use a named group of paths')),
41 ('', 'ignore-errors', None, _('continue execution despite errors')), 47 ('', 'ignore-errors', None, _('continue execution despite errors')),
42 ('f', 'force', None, _('force push')), 48 ] + _original_options('push'),
43 ('r', 'rev', [], _('a changeset intended to be included in the destination'), _('REV')), 49 _('[-g GROUP] [--ignore-errors] <push options>')),
44 ('B', 'bookmark', [], _('bookmark to push'), _('BOOKMARK')),
45 ('b', 'branch', [], _('a specific branch you would like to push'), _('BRANCH')),
46 ('', 'new-branch', False, _('allow pushing a new branch'))
47 ],
48 _('[-g GROUP] [--ignore-errors] <push options>'))
49 } 50 }