Show More
@@ -18,7 +18,6 b' Data depends on type.' | |||
|
18 | 18 | """ |
|
19 | 19 | |
|
20 | 20 | from mercurial.node import nullrev |
|
21 | import re | |
|
22 | 21 | |
|
23 | 22 | CHANGESET = 'C' |
|
24 | 23 | |
@@ -87,17 +86,14 b' def colored(dag, repo):' | |||
|
87 | 86 | config = {} |
|
88 | 87 | |
|
89 | 88 | for key, val in repo.ui.configitems('graph'): |
|
90 |
if '.' |
|
|
91 | continue | |
|
92 | branch, setting = key.rsplit('.', 1) | |
|
93 | gdict = config.setdefault(branch, {}) | |
|
89 | if '.' in key: | |
|
90 | branch, setting = key.rsplit('.', 1) | |
|
91 | # Validation | |
|
92 | if setting == "width" and val.isdigit(): | |
|
93 | config.setdefault(branch, {})[setting] = val | |
|
94 | elif setting == "color" and val.isalnum(): | |
|
95 | config.setdefault(branch, {})[setting] = val | |
|
94 | 96 | |
|
95 | # Validation | |
|
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))): | |
|
98 | gdict[setting] = val | |
|
99 | else: | |
|
100 | continue | |
|
101 | 97 | |
|
102 | 98 | for (cur, type, data, parents) in dag: |
|
103 | 99 |
General Comments 0
You need to be logged in to leave comments.
Login now