diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/sync.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index b1b6a6ef..d1b631ae 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | # limitations under the License. | 13 | # limitations under the License. |
| 14 | 14 | ||
| 15 | import http.cookiejar as cookielib | 15 | import http.cookiejar as cookielib |
| 16 | import io | ||
| 16 | import json | 17 | import json |
| 17 | import netrc | 18 | import netrc |
| 18 | from optparse import SUPPRESS_HELP | 19 | from optparse import SUPPRESS_HELP |
| @@ -354,6 +355,7 @@ later is required to fix a server side protocol bug. | |||
| 354 | # - We always make sure we unlock the lock if we locked it. | 355 | # - We always make sure we unlock the lock if we locked it. |
| 355 | start = time.time() | 356 | start = time.time() |
| 356 | success = False | 357 | success = False |
| 358 | buf = io.StringIO() | ||
| 357 | with lock: | 359 | with lock: |
| 358 | pm.start(project.name) | 360 | pm.start(project.name) |
| 359 | try: | 361 | try: |
| @@ -361,6 +363,7 @@ later is required to fix a server side protocol bug. | |||
| 361 | success = project.Sync_NetworkHalf( | 363 | success = project.Sync_NetworkHalf( |
| 362 | quiet=opt.quiet, | 364 | quiet=opt.quiet, |
| 363 | verbose=opt.verbose, | 365 | verbose=opt.verbose, |
| 366 | output_redir=buf, | ||
| 364 | current_branch_only=opt.current_branch_only, | 367 | current_branch_only=opt.current_branch_only, |
| 365 | force_sync=opt.force_sync, | 368 | force_sync=opt.force_sync, |
| 366 | clone_bundle=opt.clone_bundle, | 369 | clone_bundle=opt.clone_bundle, |
| @@ -376,6 +379,10 @@ later is required to fix a server side protocol bug. | |||
| 376 | lock.acquire() | 379 | lock.acquire() |
| 377 | did_lock = True | 380 | did_lock = True |
| 378 | 381 | ||
| 382 | output = buf.getvalue() | ||
| 383 | if opt.verbose and output: | ||
| 384 | pm.update(inc=0, msg=output.rstrip()) | ||
| 385 | |||
| 379 | if not success: | 386 | if not success: |
| 380 | err_event.set() | 387 | err_event.set() |
| 381 | print('error: Cannot fetch %s from %s' | 388 | print('error: Cannot fetch %s from %s' |
