diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2017-04-25 12:04:13 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2017-04-25 12:28:08 +0200 |
commit | 574b155cf6ac866f812e7aacd4c54efa0f0628f6 (patch) | |
tree | be84eb41b74a0ac914143324ef38002b3fc22af1 /python/servo/devenv_commands.py | |
parent | c5c6e8c442eb670093561af85c7606262a0f7318 (diff) | |
download | servo-574b155cf6ac866f812e7aacd4c54efa0f0628f6.tar.gz servo-574b155cf6ac866f812e7aacd4c54efa0f0628f6.zip |
Add `./mach cargoup`
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r-- | python/servo/devenv_commands.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index d414a3324bc..314c5c2b8c1 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -233,7 +233,7 @@ class MachCommands(CommandBase): commit = json.load(urllib2.urlopen(url))["object"]["sha"] filename = path.join(self.context.topdir, "rust-commit-hash") with open(filename, "w") as f: - f.write(commit) + f.write(commit + "\n") # Reset self.config["tools"]["rust-root"] self._rust_version = None @@ -241,6 +241,22 @@ class MachCommands(CommandBase): self.fetch() + @Command('cargoup', + description='Update the Cargo version to latest master', + category='devenv') + def cargoup(self): + url = "https://api.github.com/repos/rust-lang/cargo/git/refs/heads/master" + commit = json.load(urllib2.urlopen(url))["object"]["sha"] + filename = path.join(self.context.topdir, "cargo-commit-hash") + with open(filename, "w") as f: + f.write(commit + "\n") + + # Reset self.config["tools"]["cargo-root"] + self._cargo_build_id = None + self.set_cargo_root() + + self.fetch() + @Command('fetch', description='Fetch Rust, Cargo and Cargo dependencies', category='devenv') |