equal
deleted
inserted
replaced
16 context of the graph returned. Type is a constant specifying the node type. |
16 context of the graph returned. Type is a constant specifying the node type. |
17 Data depends on type. |
17 Data depends on type. |
18 """ |
18 """ |
19 |
19 |
20 from mercurial.node import nullrev |
20 from mercurial.node import nullrev |
|
21 import re |
21 |
22 |
22 CHANGESET = 'C' |
23 CHANGESET = 'C' |
23 |
24 |
24 def dagwalker(repo, revs): |
25 def dagwalker(repo, revs): |
25 """cset DAG generator yielding (id, CHANGESET, ctx, [parentids]) tuples |
26 """cset DAG generator yielding (id, CHANGESET, ctx, [parentids]) tuples |
90 continue |
91 continue |
91 branch, setting = key.rsplit('.', 1) |
92 branch, setting = key.rsplit('.', 1) |
92 gdict = config.setdefault(branch, {}) |
93 gdict = config.setdefault(branch, {}) |
93 |
94 |
94 # Validation |
95 # Validation |
95 if (setting == "width" and val.isdigit() and 0 < int(val) < 30): |
96 if ((setting == "width" and val.isdigit() and 0 < int(val) < 30) or |
|
97 (setting == "color" and re.match('^[0-9a-fA-F]{6}$', val))): |
96 gdict[setting] = val |
98 gdict[setting] = val |
97 else: |
99 else: |
98 continue |
100 continue |
99 |
101 |
100 for (cur, type, data, parents) in dag: |
102 for (cur, type, data, parents) in dag: |