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

Unified Diff: tools/git-sync-deps

Issue 1431713002: tools/git-sync-deps: speed up common case by skipping fetch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/git-sync-deps
diff --git a/tools/git-sync-deps b/tools/git-sync-deps
index 1d626d066ccf9c6f55912fd845bd330471a9c448..92b329066a73c5312dad4e05ebba2cd20bf83926 100755
--- a/tools/git-sync-deps
+++ b/tools/git-sync-deps
@@ -133,6 +133,16 @@ def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
sys.stdout.write('%s\n SYNC IS DISABLED.\n' % directory)
return
+ try:
+ # if this succeeds, skip slow `git fetch`.
+ subprocess.check_call(
mtklein 2015/11/03 17:29:29 if 0 == subprocess.call(...): if verbose: ..
hal.canary 2015/11/03 17:35:15 done
+ [git, 'checkout', '--quiet', checkoutable], cwd=directory)
+ if verbose:
+ sys.stdout.write('%s\n @ %s\n' % (directory, checkoutable))
+ return
+ except subprocess.CalledProcessError:
+ pass
+
subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
subprocess.check_call(
@@ -176,7 +186,7 @@ def git_sync_deps(deps_file_path, command_line_os_requests, verbose):
if '@' in dependencies[directory]:
repo, checkoutable = dependencies[directory].split('@', 1)
else:
- repo, checkoutable = dependencies[directory], 'origin/master'
+ raise Exception("please specify commit or tag")
relative_directory = os.path.join(deps_file_directory, directory)
« 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