Mercurial > hg
comparison mercurial/fancyopts.py @ 5093:88803a69b24a
fancyopts: Copy list arguments in command table before modifying.
Before this, executing
commands.dispatch(['log', '-r', '0'])
commands.dispatch(['log', '-r', 'tip'])
would look like:
hg log -r 0
hg log -r 0 -r tip
Reported by TK Soh, patch by Alexis S. L. Carvalho
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 11 Aug 2007 13:07:47 +0200 |
parents | f9567a7fa3b3 |
children | a9b7e425674f |
comparison
equal
deleted
inserted
replaced
5092:6e040f6c2c9c | 5093:88803a69b24a |
---|---|
7 dt = {} | 7 dt = {} |
8 | 8 |
9 for s, l, d, c in options: | 9 for s, l, d, c in options: |
10 pl = l.replace('-', '_') | 10 pl = l.replace('-', '_') |
11 map['-'+s] = map['--'+l] = pl | 11 map['-'+s] = map['--'+l] = pl |
12 state[pl] = d | 12 if isinstance(d, list): |
13 state[pl] = d[:] | |
14 else: | |
15 state[pl] = d | |
13 dt[pl] = type(d) | 16 dt[pl] = type(d) |
14 if (d is not None and d is not True and d is not False and | 17 if (d is not None and d is not True and d is not False and |
15 not callable(d)): | 18 not callable(d)): |
16 if s: s += ':' | 19 if s: s += ':' |
17 if l: l += '=' | 20 if l: l += '=' |