##// END OF EJS Templates
graphmod: rewrite graph config validation...
Matt Mackall -
r16131:6f236c8b default
parent child Browse files
Show More
@@ -18,7 +18,6 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 def colored(dag, repo):
87 86 config = {}
88 87
89 88 for key, val in repo.ui.configitems('graph'):
90 if '.' not in key:
91 continue
89 if '.' in key:
92 90 branch, setting = key.rsplit('.', 1)
93 gdict = config.setdefault(branch, {})
94
95 91 # 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
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
96
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