def get_mercurial_default_options_dict(command, command_table=None, **kwd):
 if (command_table is None):
  command_table = commands.table
 possible = cmdutil.findpossible(command, command_table)
 if (type(possible) is tuple):
  possible = possible[0]
 if (len(possible) != 1):
  raise Exception(('unable to find mercurial command "%s"' % command))
 default_options_dict = dict(((r[1].replace('-', '_'), r[2]) for r in next(iter(possible.values()))[1][1]))
 for option in kwd:
  default_options_dict[option] = kwd[option]
 return default_options_dict

def get_mercurial_default_options_dict ( command , command_table = None , ** kwd ) : if ( command_table is None ) : command_table = commands . table possible = cmdutil . findpossible ( command , command_table ) if ( type ( possible ) is tuple ) : possible = possible [ 0 ] if ( len ( possible ) != 1 ) : raise Exception ( ( 'unable to find mercurial command "%s"' % command ) ) default_options_dict = dict ( ( ( r [ 1 ] . replace ( '-' , '_' ) , r [ 2 ] ) for r in next ( iter ( possible . values ( ) ) ) [ 1 ] [ 1 ] ) ) for option in kwd : default_options_dict [ option ] = kwd [ option ] return default_options_dict
borrowed from repoman - get default parameters for a mercurial command .