summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2011-03-22 19:04:47 -0700
committerShawn O. Pearce <sop@google.com>2011-03-22 19:04:47 -0700
commite6a0eeb80d46a5e5e99ce17a46f93e83ee2782cc (patch)
treeb9bb6905b377274f44331cf74c1bf29e50799ceb /subcmds
parent0960b5b53df6df7169c295de5509b0f705352d3b (diff)
downloadgit-repo-e6a0eeb80d46a5e5e99ce17a46f93e83ee2782cc.tar.gz
sync: Fix syntax error on Python 2.4v1.7.4.2
Change-Id: I371d032d5a1ddde137721cbe2b24bfa38f20aaaa Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/sync.py45
1 files changed, 23 insertions, 22 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index eac0556d..4a544706 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -164,31 +164,32 @@ later is required to fix a server side protocol bug.
164 # - We always make sure we call sem.release(). 164 # - We always make sure we call sem.release().
165 # - We always make sure we unlock the lock if we locked it. 165 # - We always make sure we unlock the lock if we locked it.
166 try: 166 try:
167 success = project.Sync_NetworkHalf(quiet=opt.quiet) 167 try:
168 success = project.Sync_NetworkHalf(quiet=opt.quiet)
168 169
169 # Lock around all the rest of the code, since printing, updating a set 170 # Lock around all the rest of the code, since printing, updating a set
170 # and Progress.update() are not thread safe. 171 # and Progress.update() are not thread safe.
171 lock.acquire() 172 lock.acquire()
172 did_lock = True 173 did_lock = True
173 174
174 if not success: 175 if not success:
175 print >>sys.stderr, 'error: Cannot fetch %s' % project.name 176 print >>sys.stderr, 'error: Cannot fetch %s' % project.name
176 if opt.force_broken: 177 if opt.force_broken:
177 print >>sys.stderr, 'warn: --force-broken, continuing to sync' 178 print >>sys.stderr, 'warn: --force-broken, continuing to sync'
178 else: 179 else:
179 raise _FetchError() 180 raise _FetchError()
180 181
181 fetched.add(project.gitdir) 182 fetched.add(project.gitdir)
182 pm.update() 183 pm.update()
183 except BaseException, e: 184 except BaseException, e:
184 # Notify the _Fetch() function about all errors. 185 # Notify the _Fetch() function about all errors.
185 err_event.set() 186 err_event.set()
186 187
187 # If we got our own _FetchError, we don't want a stack trace. 188 # If we got our own _FetchError, we don't want a stack trace.
188 # However, if we got something else (something in Sync_NetworkHalf?), 189 # However, if we got something else (something in Sync_NetworkHalf?),
189 # we'd like one (so re-raise after we've set err_event). 190 # we'd like one (so re-raise after we've set err_event).
190 if not isinstance(e, _FetchError): 191 if not isinstance(e, _FetchError):
191 raise 192 raise
192 finally: 193 finally:
193 if did_lock: 194 if did_lock:
194 lock.release() 195 lock.release()