# HG changeset patch # User Jeff Hammel # Date 1376194422 25200 # Node ID c9aab7092af14972a1ce385908452836bd3b0bb4 # Parent e192c235d5d65544bd87baeae6123b8c3aa44bf9 python/hgrc.py diff -r e192c235d5d6 -r c9aab7092af1 python/hgrc.py --- a/python/hgrc.py Sat Aug 10 21:05:48 2013 -0700 +++ b/python/hgrc.py Sat Aug 10 21:13:42 2013 -0700 @@ -21,18 +21,19 @@ def __init__(self, section_name, *section_names): self.sections = [section_name] self.sections.extend(section_names) - def __call__(self, parser): + def __call__(self, function): def wrapped(parser, *args, **kwargs): for section in self.sections: if section not in parser.sections(): parser.add_section(section) - f(*args, **kwargs) + function(parser, *args, **kwargs) return wrapped #@parser # decorator makes this x-form path -> ConfigParser automagically @section('paths') def set_default(parser, default): """set [paths]:default""" + print 'OIOIOIOI!' @section('paths') def set_default_push(parser, default_push): @@ -176,7 +177,7 @@ print_ini = actions.pop('print_ini', None) # alter .hgrc files - for action_name, parameter in actions: + for action_name, parameter in actions.items(): # XXX crappy method = action_map[action_name] @@ -187,10 +188,10 @@ for path, ini in config.items(): # call method with parser - if parameter is not None: + if parameter is None: + method(ini) + else: method(ini, parameter) - else: - method(ini) # print .hgrc files, if specified if print_ini: