Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: ensure_dependencies.py

Issue 6018170477346816: 1588 - Integrate ensure_dependencies.py with the adblockplus repository (Closed)
Left Patch Set: 1588 - Integrate ensure_dependencies.py with the adblockplus repository Created Dec. 17, 2014, 4:17 p.m.
Right Patch Set: '1588 - Integrate ensure_dependencies.py with the adblockplus repository' Created Jan. 13, 2015, 4:44 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « dependencies ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # coding: utf-8 2 # coding: utf-8
3 3
4 # This Source Code Form is subject to the terms of the Mozilla Public 4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this 5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 7
8 import sys 8 import sys
9 import os 9 import os
10 import posixpath 10 import posixpath
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 def istype(self, repodir): 82 def istype(self, repodir):
83 return os.path.exists(os.path.join(repodir, ".git")) 83 return os.path.exists(os.path.join(repodir, ".git"))
84 84
85 def clone(self, source, target): 85 def clone(self, source, target):
86 source = source.rstrip("/") 86 source = source.rstrip("/")
87 if not source.endswith(".git"): 87 if not source.endswith(".git"):
88 source += ".git" 88 source += ".git"
89 subprocess.check_call(["git", "clone", "--quiet", source, target]) 89 subprocess.check_call(["git", "clone", "--quiet", source, target])
90 90
91 def get_revision_id(self, repo, rev="HEAD"): 91 def get_revision_id(self, repo, rev="HEAD"):
92 command = ["git", "rev-parse", "--revs-only", rev] 92 command = ["git", "rev-parse", "--revs-only", rev + '^{commit}']
93 return subprocess.check_output(command, cwd=repo).strip() 93 return subprocess.check_output(command, cwd=repo).strip()
94 94
95 def pull(self, repo): 95 def pull(self, repo):
96 subprocess.check_call(["git", "fetch", "--quiet", "--all", "--tags"], cwd=re po) 96 subprocess.check_call(["git", "fetch", "--quiet", "--all", "--tags"], cwd=re po)
97 97
98 def update(self, repo, rev): 98 def update(self, repo, rev):
99 subprocess.check_call(["git", "checkout", "--quiet", rev], cwd=repo) 99 subprocess.check_call(["git", "checkout", "--quiet", rev], cwd=repo)
100 100
101 def ignore(self, target, repo): 101 def ignore(self, target, repo):
102 module = os.path.relpath(target, repo) 102 module = os.path.relpath(target, repo)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 for l in file_content: 276 for l in file_content:
277 print >>f, l 277 print >>f, l
278 278
279 if __name__ == "__main__": 279 if __name__ == "__main__":
280 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) 280 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
281 repos = sys.argv[1:] 281 repos = sys.argv[1:]
282 if not len(repos): 282 if not len(repos):
283 repos = [os.getcwd()] 283 repos = [os.getcwd()]
284 for repo in repos: 284 for repo in repos:
285 resolve_deps(repo) 285 resolve_deps(repo)
LEFTRIGHT
« dependencies ('k') | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld