summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--subcmds/sync.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 1f4b137f..ca78467b 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -70,6 +70,9 @@ The -s/--smart-sync option can be used to sync to a known good
70build as specified by the manifest-server element in the current 70build as specified by the manifest-server element in the current
71manifest. 71manifest.
72 72
73The -f/--force-broken option can be used to proceed with syncing
74other projects if a project sync fails.
75
73SSH Connections 76SSH Connections
74--------------- 77---------------
75 78
@@ -101,6 +104,9 @@ later is required to fix a server side protocol bug.
101""" 104"""
102 105
103 def _Options(self, p, show_smart=True): 106 def _Options(self, p, show_smart=True):
107 p.add_option('-f', '--force-broken',
108 dest='force_broken', action='store_true',
109 help="continue sync even if a project fails to sync")
104 p.add_option('-l','--local-only', 110 p.add_option('-l','--local-only',
105 dest='local_only', action='store_true', 111 dest='local_only', action='store_true',
106 help="only update working tree, don't fetch") 112 help="only update working tree, don't fetch")
@@ -132,8 +138,11 @@ later is required to fix a server side protocol bug.
132 def _FetchHelper(self, opt, project, lock, fetched, pm, sem): 138 def _FetchHelper(self, opt, project, lock, fetched, pm, sem):
133 if not project.Sync_NetworkHalf(quiet=opt.quiet): 139 if not project.Sync_NetworkHalf(quiet=opt.quiet):
134 print >>sys.stderr, 'error: Cannot fetch %s' % project.name 140 print >>sys.stderr, 'error: Cannot fetch %s' % project.name
135 sem.release() 141 if opt.force_broken:
136 sys.exit(1) 142 print >>sys.stderr, 'warn: --force-broken, continuing to sync'
143 else:
144 sem.release()
145 sys.exit(1)
137 146
138 lock.acquire() 147 lock.acquire()
139 fetched.add(project.gitdir) 148 fetched.add(project.gitdir)
@@ -152,7 +161,10 @@ later is required to fix a server side protocol bug.
152 fetched.add(project.gitdir) 161 fetched.add(project.gitdir)
153 else: 162 else:
154 print >>sys.stderr, 'error: Cannot fetch %s' % project.name 163 print >>sys.stderr, 'error: Cannot fetch %s' % project.name
155 sys.exit(1) 164 if opt.force_broken:
165 print >>sys.stderr, 'warn: --force-broken, continuing to sync'
166 else:
167 sys.exit(1)
156 else: 168 else:
157 threads = set() 169 threads = set()
158 lock = _threading.Lock() 170 lock = _threading.Lock()