From 42ba8628d81e42a9826f958b3bf222db203e443a Mon Sep 17 00:00:00 2001 From: "msb@chromium.org" Date: Tue, 20 Jul 2010 18:47:18 +0000 Subject: [PATCH] gclient: fetch only what's needed To reduce server load, only fetch the ref we need. This is a redo of: http://codereview.chromium.org/2856038 First upload was the original CL 2856038. Subsequent uploads are my changes. TEST=ran presubmit tests Review URL: http://codereview.chromium.org/2842060 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@53072 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gclient_scm.py b/gclient_scm.py index a76d2d0c2..928ffdf1c 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -257,7 +257,13 @@ class GitWrapper(SCMWrapper): # Update the remotes first so we have all the refs. for _ in range(10): try: - remote_output, remote_err = scm.GIT.Capture( + if rev_type == "branch": + remote_output, remote_err = scm.GIT.Capture( + ['fetch'] + verbose + ['origin', revision], + self.checkout_path, + print_error=False) + else: + remote_output, remote_err = scm.GIT.Capture( ['remote'] + verbose + ['update'], self.checkout_path, print_error=False)