diff --git a/hgext/convert/filemap.py b/hgext/convert/filemap.py --- a/hgext/convert/filemap.py +++ b/hgext/convert/filemap.py @@ -33,10 +33,20 @@ class filemapper(object): def parse(self, path): errs = 0 def check(name, mapping, listname): + if not name: + self.ui.warn(_('%s:%d: path to %s is missing\n') % + (lex.infile, lex.lineno, listname)) + return 1 if name in mapping: self.ui.warn(_('%s:%d: %r already in %s list\n') % (lex.infile, lex.lineno, name, listname)) return 1 + if (name.startswith('/') or + name.endswith('/') or + '//' in name): + self.ui.warn(_('%s:%d: superfluous / in %s %r\n') % + (lex.infile, lex.lineno, listname, name)) + return 1 return 0 lex = shlex.shlex(open(path), path, True) lex.wordchars += '!@#$%^&*()-=+[]{}|;:,./<>?' diff --git a/tests/test-convert-filemap b/tests/test-convert-filemap --- a/tests/test-convert-filemap +++ b/tests/test-convert-filemap @@ -128,3 +128,14 @@ echo 'copied:' hg --cwd source cat copied echo 'copied2:' hg --cwd renames.repo cat copied2 + +echo % filemap errors +cat > errors.fmap <