Show More
@@ -29,27 +29,6 b' VALID_PREFIXES = (' | |||
|
29 | 29 | b'rootfilesin:', |
|
30 | 30 | ) |
|
31 | 31 | |
|
32 | def parseserverpatterns(text): | |
|
33 | """Parses the narrowspec format that's returned by the server.""" | |
|
34 | includepats = set() | |
|
35 | excludepats = set() | |
|
36 | ||
|
37 | # We get one entry per line, in the format "<key> <value>". | |
|
38 | # It's OK for value to contain other spaces. | |
|
39 | for kp in (l.split(' ', 1) for l in text.splitlines()): | |
|
40 | if len(kp) != 2: | |
|
41 | raise error.Abort(_('Invalid narrowspec pattern line: "%s"') % kp) | |
|
42 | key = kp[0] | |
|
43 | pat = kp[1] | |
|
44 | if key == 'include': | |
|
45 | includepats.add(pat) | |
|
46 | elif key == 'exclude': | |
|
47 | excludepats.add(pat) | |
|
48 | else: | |
|
49 | raise error.Abort(_('Invalid key "%s" in server response') % key) | |
|
50 | ||
|
51 | return includepats, excludepats | |
|
52 | ||
|
53 | 32 | def normalizesplitpattern(kind, pat): |
|
54 | 33 | """Returns the normalized version of a pattern and kind. |
|
55 | 34 |
General Comments 0
You need to be logged in to leave comments.
Login now