Mercurial > hg > config
comparison python/hgrc.py @ 479:0a9e1e0d077c
python/hgrc.py
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 10 Aug 2013 19:51:35 -0700 |
parents | df60292c29b2 |
children | 529fd4e1087e |
comparison
equal
deleted
inserted
replaced
478:df60292c29b2 | 479:0a9e1e0d077c |
---|---|
14 import urlparse | 14 import urlparse |
15 from ConfigParser import RawConfigParser as ConfigParser | 15 from ConfigParser import RawConfigParser as ConfigParser |
16 | 16 |
17 #@parser # decorator makes this x-form path -> ConfigParser automagically | 17 #@parser # decorator makes this x-form path -> ConfigParser automagically |
18 #@section('paths') | 18 #@section('paths') |
19 def set_default(parser, default): | |
20 """set [paths]:default""" | |
21 | |
19 def set_default_push(parser, default_push): | 22 def set_default_push(parser, default_push): |
20 """ | 23 """ |
21 set [paths]:default-push to `default_push` | 24 set [paths]:default-push to `default_push` |
22 """ | 25 """ |
23 if 'paths' not in parser.sections(): | 26 if 'paths' not in parser.sections(): |
60 parser.add_option('--ssh', dest='default_push_ssh', | 63 parser.add_option('--ssh', dest='default_push_ssh', |
61 action='store_true', default=False, | 64 action='store_true', default=False, |
62 help="use `default` entries for `default-push`") | 65 help="use `default` entries for `default-push`") |
63 parser.add_option('--push', '--default-push', dest='default_push', | 66 parser.add_option('--push', '--default-push', dest='default_push', |
64 help="set [paths] default-push location") | 67 help="set [paths] default-push location") |
68 parser.add_option('--default', dest='default', | |
69 help="set [paths] default entry") | |
65 parser.add_option('-p', '--print', dest='print_ini', | 70 parser.add_option('-p', '--print', dest='print_ini', |
66 action='store_true', default=False, | 71 action='store_true', default=False, |
67 help="print .ini contents") | 72 help="print .ini contents") |
68 options, args = parser.parse_args(args) | 73 options, args = parser.parse_args(args) |
69 | 74 |