Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove: warns about removing files which are gone already when rm'ing directory #3441

Closed
yarikoptic opened this issue May 20, 2019 · 2 comments · Fixed by #3586
Closed

remove: warns about removing files which are gone already when rm'ing directory #3441

yarikoptic opened this issue May 20, 2019 · 2 comments · Fixed by #3586

Comments

@yarikoptic
Copy link
Member

$> mkdir subdir2; echo 124 > subdir2/124; datalad save -m "added 124 to subdir2" --to-git subdir2/124
add(ok): subdir2/124 (file)
save(ok): . (dataset)
action summary:
  add (ok: 1)
  save (ok: 1)

$> datalad remove subdir2                                                                            
remove(ok): subdir2/124  
[WARNING] path does not exist: /tmp/testds-remove/subdir2/124 [save(/tmp/testds-remove/subdir2/124)] 
save(ok): /tmp/testds-remove (dataset)
action summary:
  drop (notneeded: 1)
  remove (ok: 1)
  save (ok: 1)

datalad 0.12.0rc4.dev5

Got flooded with those warnings, git reset --hard within each submodule, and did "revolution" way with just a regular rm and then datalad save -- worked out nicely (besides again flooding the terminal with thousands of "delete(ok)" messages).

Since I think remove is still to stay in the API (or not?) decided to file an issue

@yarikoptic
Copy link
Member Author

yarikoptic commented Aug 3, 2019

@kyleam would you be so kind to check this one out? I kept waiting for probably over 30 min already for these WARNINGS to finally exhaust themselves on two sizeable repos. (in my case UX pains were amplified also by #2673)

PS edit1 FWIW -- it takes probably ~1sec from one warning to another in my case

@kyleam
Copy link
Contributor

kyleam commented Aug 5, 2019

I think fixing this on master comes down to rewriting remove.py to use core/local/save.py. I'll check, but I imagine that, if it were as simple as "substitute the new save in, passing string paths rather than annotated paths", it would have been done with the rev-save to save rename. So the best path forward may be to strip annotate_paths() usage from remove.py (which would move gh-3368 forward).

Re: datalad/datalad-container#59

kyleam added a commit to kyleam/datalad that referenced this issue Aug 5, 2019
rev_save() has been promoted to save(), but there are still a few
places where the obsolete save() is used.  One of these spots is
remove.py, where 1c49a1f (MNT: interface.save: Demote and mark
obsolete, 2019-05-14) claimed the old save() is needed because
annotated paths are passed as arguments.  But instead of punting until
annotate_paths() use is dropped from remove.py (dataladgh-3368), we can make
the call compatible with the new save() by pulling out the paths from
the annotated paths record.

In addition to dropping the internal use of an obsolete command, this
avoids spurious warnings about removed files not existing.

Closes datalad#3441.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants