diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/sync.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 97da6204..2973a16e 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -315,9 +315,6 @@ later is required to fix a server side protocol bug. | |||
315 | # We'll set to true once we've locked the lock. | 315 | # We'll set to true once we've locked the lock. |
316 | did_lock = False | 316 | did_lock = False |
317 | 317 | ||
318 | if not opt.quiet: | ||
319 | print('Fetching project %s' % project.name) | ||
320 | |||
321 | # Encapsulate everything in a try/except/finally so that: | 318 | # Encapsulate everything in a try/except/finally so that: |
322 | # - We always set err_event in the case of an exception. | 319 | # - We always set err_event in the case of an exception. |
323 | # - We always make sure we unlock the lock if we locked it. | 320 | # - We always make sure we unlock the lock if we locked it. |
@@ -350,7 +347,7 @@ later is required to fix a server side protocol bug. | |||
350 | raise _FetchError() | 347 | raise _FetchError() |
351 | 348 | ||
352 | fetched.add(project.gitdir) | 349 | fetched.add(project.gitdir) |
353 | pm.update() | 350 | pm.update(msg=project.name) |
354 | except _FetchError: | 351 | except _FetchError: |
355 | pass | 352 | pass |
356 | except Exception as e: | 353 | except Exception as e: |
@@ -371,7 +368,6 @@ later is required to fix a server side protocol bug. | |||
371 | fetched = set() | 368 | fetched = set() |
372 | lock = _threading.Lock() | 369 | lock = _threading.Lock() |
373 | pm = Progress('Fetching projects', len(projects), | 370 | pm = Progress('Fetching projects', len(projects), |
374 | print_newline=not(opt.quiet), | ||
375 | always_print_percentage=opt.quiet) | 371 | always_print_percentage=opt.quiet) |
376 | 372 | ||
377 | objdir_project_map = dict() | 373 | objdir_project_map = dict() |
@@ -461,9 +457,6 @@ later is required to fix a server side protocol bug. | |||
461 | # We'll set to true once we've locked the lock. | 457 | # We'll set to true once we've locked the lock. |
462 | did_lock = False | 458 | did_lock = False |
463 | 459 | ||
464 | if not opt.quiet: | ||
465 | print('Checking out project %s' % project.name) | ||
466 | |||
467 | # Encapsulate everything in a try/except/finally so that: | 460 | # Encapsulate everything in a try/except/finally so that: |
468 | # - We always set err_event in the case of an exception. | 461 | # - We always set err_event in the case of an exception. |
469 | # - We always make sure we unlock the lock if we locked it. | 462 | # - We always make sure we unlock the lock if we locked it. |
@@ -474,11 +467,11 @@ later is required to fix a server side protocol bug. | |||
474 | try: | 467 | try: |
475 | try: | 468 | try: |
476 | project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync) | 469 | project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync) |
477 | success = syncbuf.Finish() | ||
478 | 470 | ||
479 | # Lock around all the rest of the code, since printing, updating a set | 471 | # Lock around all the rest of the code, since printing, updating a set |
480 | # and Progress.update() are not thread safe. | 472 | # and Progress.update() are not thread safe. |
481 | lock.acquire() | 473 | lock.acquire() |
474 | success = syncbuf.Finish() | ||
482 | did_lock = True | 475 | did_lock = True |
483 | 476 | ||
484 | if not success: | 477 | if not success: |
@@ -487,7 +480,7 @@ later is required to fix a server side protocol bug. | |||
487 | file=sys.stderr) | 480 | file=sys.stderr) |
488 | raise _CheckoutError() | 481 | raise _CheckoutError() |
489 | 482 | ||
490 | pm.update() | 483 | pm.update(msg=project.name) |
491 | except _CheckoutError: | 484 | except _CheckoutError: |
492 | pass | 485 | pass |
493 | except Exception as e: | 486 | except Exception as e: |
@@ -527,7 +520,7 @@ later is required to fix a server side protocol bug. | |||
527 | syncjobs = 1 | 520 | syncjobs = 1 |
528 | 521 | ||
529 | lock = _threading.Lock() | 522 | lock = _threading.Lock() |
530 | pm = Progress('Syncing work tree', len(all_projects)) | 523 | pm = Progress('Checking out projects', len(all_projects)) |
531 | 524 | ||
532 | threads = set() | 525 | threads = set() |
533 | sem = _threading.Semaphore(syncjobs) | 526 | sem = _threading.Semaphore(syncjobs) |