Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto clean old nightlies on Travis #16573

Merged
merged 2 commits into from Apr 23, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Optimize `clean-nightlies`

  • Loading branch information
UK992 committed Apr 22, 2017
commit c5f13063a52f4ca415f90f3f259072af368ba79c
@@ -306,19 +306,14 @@ def clean_nightlies(self, force=False, keep=None):
for tool in ["rust", "cargo"]:
commit_file = '{}-commit-hash'.format(tool)
cmd = subprocess.Popen(
['git', 'log', '--pretty=format:%H', '-n', keep, commit_file],
['git', 'log', '--oneline', '--no-color', '-n', keep, '--patch', commit_file],
stdout=subprocess.PIPE,
universal_newlines=True
)
stdout, _ = cmd.communicate()
for commit in stdout.splitlines():
cmd = subprocess.Popen(
['git', 'show', '{}:{}'.format(commit, commit_file)],
stdout=subprocess.PIPE,
universal_newlines=True
)
commit_hash, _ = cmd.communicate()
to_keep[tool].add(commit_hash.rstrip())
for line in stdout.splitlines():
if line.startswith("+") and not line.startswith("+++"):
to_keep[tool].add(line[1:])

removing_anything = False
for tool in ["rust", "cargo"]:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.