Fix './mach clean-nightlies --keep 3' not keeping anything.

This commit is contained in:
Simon Sapin 2017-10-19 17:09:09 +02:00
parent 6f52b331b8
commit 8169383485

View file

@ -306,7 +306,10 @@ class MachCommands(CommandBase):
stdout, _ = cmd.communicate()
for line in stdout.splitlines():
if line.startswith(b"+") and not line.startswith(b"+++"):
to_keep.add(line[1:])
line = line[len(b"+"):]
if line.startswith(b"nightly-"):
line = line[len(b"nightly-"):]
to_keep.add(line)
removing_anything = False
for tool in ["rust", "cargo"]: