summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2011-09-22 17:44:31 -0700
committerShawn O. Pearce <sop@google.com>2011-09-22 18:08:27 -0700
commit6392c879454bd4fa0e770195ee8424e383d17df2 (patch)
treebfbfedb0a1d7f3fbe648deaf09e570ba347feeb0 /subcmds/sync.py
parent97d2b2f7a087bfc695536ae9be962406d82152f2 (diff)
downloadgit-repo-6392c879454bd4fa0e770195ee8424e383d17df2.tar.gz
sync: Allow -j to have a default in manifestv1.7.6
This permits manifest authors to suggest a number of parallel fetch operations against a remote server. For example, Gerrit Code Review servers support queuing of requests and processes them in first-in, first-out order. Running concurrent fetches can utilize multiple CPUs on the Gerrit server, but will also decrease overall operation latency by having the request put into the queue ready to execute as soon as a CPU is free. Change-Id: I3d3904acb6f63516bae4b071c510ad57a2afab18 Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 93010c51..7ab0b1fb 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -117,6 +117,8 @@ later is required to fix a server side protocol bug.
117""" 117"""
118 118
119 def _Options(self, p, show_smart=True): 119 def _Options(self, p, show_smart=True):
120 self.jobs = self.manifest.default.sync_j
121
120 p.add_option('-f', '--force-broken', 122 p.add_option('-f', '--force-broken',
121 dest='force_broken', action='store_true', 123 dest='force_broken', action='store_true',
122 help="continue sync even if a project fails to sync") 124 help="continue sync even if a project fails to sync")
@@ -134,7 +136,8 @@ later is required to fix a server side protocol bug.
134 help='be more quiet') 136 help='be more quiet')
135 p.add_option('-j','--jobs', 137 p.add_option('-j','--jobs',
136 dest='jobs', action='store', type='int', 138 dest='jobs', action='store', type='int',
137 help="number of projects to fetch simultaneously") 139 default=self.jobs,
140 help="projects to fetch simultaneously (default %d)" % self.jobs)
138 if show_smart: 141 if show_smart:
139 p.add_option('-s', '--smart-sync', 142 p.add_option('-s', '--smart-sync',
140 dest='smart_sync', action='store_true', 143 dest='smart_sync', action='store_true',