31 raise util.Abort(_('errors in filemap')) |
31 raise util.Abort(_('errors in filemap')) |
32 |
32 |
33 def parse(self, path): |
33 def parse(self, path): |
34 errs = 0 |
34 errs = 0 |
35 def check(name, mapping, listname): |
35 def check(name, mapping, listname): |
|
36 if not name: |
|
37 self.ui.warn(_('%s:%d: path to %s is missing\n') % |
|
38 (lex.infile, lex.lineno, listname)) |
|
39 return 1 |
36 if name in mapping: |
40 if name in mapping: |
37 self.ui.warn(_('%s:%d: %r already in %s list\n') % |
41 self.ui.warn(_('%s:%d: %r already in %s list\n') % |
38 (lex.infile, lex.lineno, name, listname)) |
42 (lex.infile, lex.lineno, name, listname)) |
|
43 return 1 |
|
44 if (name.startswith('/') or |
|
45 name.endswith('/') or |
|
46 '//' in name): |
|
47 self.ui.warn(_('%s:%d: superfluous / in %s %r\n') % |
|
48 (lex.infile, lex.lineno, listname, name)) |
39 return 1 |
49 return 1 |
40 return 0 |
50 return 0 |
41 lex = shlex.shlex(open(path), path, True) |
51 lex = shlex.shlex(open(path), path, True) |
42 lex.wordchars += '!@#$%^&*()-=+[]{}|;:,./<>?' |
52 lex.wordchars += '!@#$%^&*()-=+[]{}|;:,./<>?' |
43 cmd = lex.get_token() |
53 cmd = lex.get_token() |