Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: tools/git-sync-deps

Issue 1475513004: tools/git-sync-deps: handle changing origin (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2014 Google Inc. 2 # Copyright 2014 Google Inc.
3 # 3 #
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 7
8 """Parse a DEPS file and git checkout all of the dependencies. 8 """Parse a DEPS file and git checkout all of the dependencies.
9 9
10 Args: 10 Args:
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 if 0 == subprocess.call( 136 if 0 == subprocess.call(
137 [git, 'checkout', '--quiet', checkoutable], cwd=directory): 137 [git, 'checkout', '--quiet', checkoutable], cwd=directory):
138 # if this succeeds, skip slow `git fetch`. 138 # if this succeeds, skip slow `git fetch`.
139 if verbose: 139 if verbose:
140 sys.stdout.write('%s\n @ %s\n' % (directory, checkoutable)) 140 sys.stdout.write('%s\n @ %s\n' % (directory, checkoutable))
141 return 141 return
142 142
143 subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory) 143 subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
144 144
145 subprocess.check_call( 145 if 0 != subprocess.call(
146 [git, 'checkout', '--quiet', checkoutable], cwd=directory) 146 [git, 'checkout', '--quiet', checkoutable], cwd=directory):
147 subprocess.check_call([git, 'remote', 'set-url', repo], cwd=directory)
148 subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
149 subprocess.check_call([git, 'checkout', '--quiet'], cwd=directory)
147 150
148 if verbose: 151 if verbose:
149 sys.stdout.write('%s\n @ %s\n' % (directory, checkoutable)) # Success. 152 sys.stdout.write('%s\n @ %s\n' % (directory, checkoutable)) # Success.
150 153
151 154
152 def parse_file_to_dict(path): 155 def parse_file_to_dict(path):
153 dictionary = {} 156 dictionary = {}
154 execfile(path, dictionary) 157 execfile(path, dictionary)
155 return dictionary 158 return dictionary
156 159
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if '--help' in argv or '-h' in argv: 220 if '--help' in argv or '-h' in argv:
218 usage(deps_file_path) 221 usage(deps_file_path)
219 return 1 222 return 1
220 223
221 git_sync_deps(deps_file_path, argv, verbose) 224 git_sync_deps(deps_file_path, argv, verbose)
222 return 0 225 return 0
223 226
224 227
225 if __name__ == '__main__': 228 if __name__ == '__main__':
226 exit(main(sys.argv[1:])) 229 exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698