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

Use fromkey to create unlocked files when supported #5630

Merged
merged 3 commits into from May 4, 2021

Conversation

kyleam
Copy link
Contributor

@kyleam kyleam commented May 3, 2021

addurls and copy-file avoid fromkey on adjusted branches because fromkey unconditionally creates a symbolic link, but that's no longer needed as of git-annex's 4588668a1 (fromkey unlocked files support, 2021-05-03).

The main behavioral change/improvement here is that copy-file no longer yields an error result when the copied file doesn't have content and the destination repo is on an adjusted branch.

I've tested this locally with git-annex's e811a50e2 (2021-05-03).

kyleam added 3 commits May 3, 2021 15:04
Before 4588668a1 (fromkey unlocked files support, 2021-05-03),
git-annex-fromkey tries to create a symbolic link even when called on
an adjusted branch.  A couple of spots in the code base work around
this, so add a _version_kludges entry that they can inspect to decide
whether they can use fromkey directly.
copy-file uses 'annex fromkey --force' to create a the file without
content and then reinjects the content if it's available.  This
doesn't work on an adjusted branch because fromkey unconditionally
tries to create a symbolic link.  To work around this, copy-file
instead does a pure copy; if the file doesn't have content, it yields
an error result.

As of git-annex 4588668a1 (fromkey unlocked files support,
2021-05-03), fromkey now supports unlocked files.  Update copy-file to
use it.
addurls() uses 'annex fromkey --force' to create a tree without
content.  However, on adjusted branches, addurls() instead writes its
own pointer file because fromkey unconditionally creates a symbolic.

As of git-annex 4588668a1 (fromkey unlocked files support,
2021-05-03), fromkey now supports unlocked files.  Update addurls() to
use it.
@codecov
Copy link

codecov bot commented May 3, 2021

Codecov Report

Merging #5630 (8fb99bb) into master (6a15be8) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5630      +/-   ##
==========================================
+ Coverage   90.35%   90.36%   +0.01%     
==========================================
  Files         305      305              
  Lines       41656    41659       +3     
==========================================
+ Hits        37637    37646       +9     
+ Misses       4019     4013       -6     
Impacted Files Coverage Δ
datalad/local/addurls.py 97.05% <100.00%> (+<0.01%) ⬆️
datalad/local/copy_file.py 96.17% <100.00%> (ø)
datalad/local/tests/test_copy_file.py 100.00% <100.00%> (ø)
datalad/support/annexrepo.py 91.62% <100.00%> (+0.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a15be8...8fb99bb. Read the comment docs.

Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thx much tracking that and implementing the checks!

@yarikoptic yarikoptic merged commit 885b2ee into datalad:master May 4, 2021
@kyleam kyleam deleted the fromkey-unlocked branch May 4, 2021 22:21
@yarikoptic yarikoptic added the semver-minor Increment the minor version when merged label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants