Skip to content

Commit d2b0dd5

Browse files
committed
progress: add main push/pull bar
Fixes iterative#3452 Related iterative#1840 Related iterative#3565
1 parent 6ab06bb commit d2b0dd5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

dvc/remote/local.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,11 @@ def _process(
341341
file_mode=self._file_mode,
342342
)
343343
status = STATUS_DELETED
344+
desc = "Pulling"
344345
else:
345346
func = remote.upload
346347
status = STATUS_NEW
348+
desc = "Pushing"
347349

348350
if jobs is None:
349351
jobs = remote.JOBS
@@ -361,11 +363,13 @@ def _process(
361363
if len(plans[0]) == 0:
362364
return 0
363365

364-
if jobs > 1:
365-
with ThreadPoolExecutor(max_workers=jobs) as executor:
366-
fails = sum(executor.map(func, *plans))
367-
else:
368-
fails = sum(map(func, *plans))
366+
with Tqdm(total=len(plans[0]), unit="file", desc=desc) as pbar:
367+
func = pbar.wrap_fn(func)
368+
if jobs > 1:
369+
with ThreadPoolExecutor(max_workers=jobs) as executor:
370+
fails = sum(executor.map(func, *plans))
371+
else:
372+
fails = sum(map(func, *plans))
369373

370374
if fails:
371375
if download:

0 commit comments

Comments
 (0)