Skip to content

Commit

Permalink
servo: Merge #16573 - Auto clean old nightlies on Travis (from UK992:…
Browse files Browse the repository at this point in the history
…travis); r=aneeshusa

This could solve `no space left` problem.

Source-Repo: https://github.com/servo/servo
Source-Revision: cc74b5b36f03dca9bd543885222ed0e6d91fedcd

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 69bc9d92343b14b567fc153b35c3af5c78f956d5
  • Loading branch information
UK992 committed Apr 23, 2017
1 parent 8d40df4 commit 9604d16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions servo/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ matrix:
- .cargo
- .servo
- $HOME/.ccache
before_cache:
- ./mach clean-nightlies --keep 2 --force
env: CCACHE=/usr/bin/ccache
addons:
apt:
Expand Down
13 changes: 4 additions & 9 deletions servo/python/servo/bootstrap_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down

0 comments on commit 9604d16

Please sign in to comment.