Fix default values and add interactive setting to [ui] section of hgrc docs.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Fix default values and add interactive setting to [ui] section of hgrc docs.
manifest hash: 211eea218970b45b2a0cdc822d5b6610a89ffbd7
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFC1pE8W7P1GVgWeRoRAof+AJ4mpm3DCRqh+9To3Gn4bpC7UGcTnQCfVIWN
5VT9pqdP6/06tH8nYgW55f4=
=uNyy
-----END PGP SIGNATURE-----
import getopt
def fancyopts(args, options, state):
long=[]
short=''
map={}
dt={}
for s, l, d, c in options:
map['-'+s] = map['--'+l]=l
state[l] = d
dt[l] = type(d)
if not d is None and not callable(d): s, l=s+':', l+'='
if s: short = short + s
if l: long.append(l)
opts, args = getopt.getopt(args, short, long)
for opt, arg in opts:
if dt[map[opt]] is type(fancyopts): state[map[opt]](state,map[opt],arg)
elif dt[map[opt]] is type(1): state[map[opt]] = int(arg)
elif dt[map[opt]] is type(''): state[map[opt]] = arg
elif dt[map[opt]] is type([]): state[map[opt]].append(arg)
elif dt[map[opt]] is type(None): state[map[opt]] = 1
return args