Bug 1233506 - Only accept positional arguments to mach try that are directories. r=jgraham

This commit is contained in:
Chris Manchester 2015-12-17 12:38:32 -08:00
parent 35f3c9ea49
commit cb4e562b6c

View File

@ -533,9 +533,9 @@ class PushToTry(MachCommandBase):
paths = []
for p in kwargs["paths"]:
p = os.path.normpath(os.path.abspath(p))
if not p.startswith(self.topsrcdir):
print('Specified path "%s" is outside of the srcdir, unable to'
' specify tests outside of the srcdir' % p)
if not (os.path.isdir(p) and p.startswith(self.topsrcdir)):
print('Specified path "%s" is not a directory under the srcdir,'
' unable to specify tests outside of the srcdir' % p)
sys.exit(1)
if len(p) <= len(self.topsrcdir):
print('Specified path "%s" is at the top of the srcdir and would'