Skip to content

Commit

Permalink
Merge pull request #6735 from mih/updateprogress
Browse files Browse the repository at this point in the history
More selective `unlock` progress reporting in noninteractive cases
  • Loading branch information
yarikoptic committed Jun 3, 2022
2 parents 69d4756 + f603ac2 commit 173dc6f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions datalad/local/unlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,18 @@ def __call__(
unit=' Files',
label='Unlocking',
total=nfiles,
noninteractive_level=logging.INFO,
)
ds = Dataset(ds_path)
for r in ds.repo._call_annex_records_items_(
["unlock"],
files=files,
):
log_progress(
lgr.info, pbar_id, "Files to unlock %i", nfiles, update=1, increment=True)
lgr.info, pbar_id,
"Files to unlock %i", nfiles,
update=1, increment=True,
noninteractive_level=logging.DEBUG)
nfiles -= 1
yield get_status_dict(
path=op.join(ds.path, r['file']),
Expand All @@ -195,7 +199,12 @@ def __call__(
# git-annex will spend considerable time after the last
# file record to finish things up, let this be known
log_progress(
lgr.info, pbar_id, "Recording unlocked state in git", update=0, increment=True)
lgr.info, pbar_id,
"Recording unlocked state in git",
update=0, increment=True,
noninteractive_level=logging.INFO)

log_progress(
lgr.info, pbar_id, "Completed unlocking files")
lgr.info, pbar_id,
"Completed unlocking files",
noninteractive_level=logging.INFO)

0 comments on commit 173dc6f

Please sign in to comment.