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

create: Allow forcibly creating a subdataset #3552

Merged
merged 2 commits into from Jul 24, 2019
Merged

Conversation

@kyleam
Copy link
Contributor

@kyleam kyleam commented Jul 23, 2019

For top-level datasets, --force can be used to ignore the "is
empty directory?" check. Make --force also disable the "is
subdataset?" check because this is consistent with the non-subdataset
behavior and was the behavior before the "rev-create -> create"
rewrite.

Fixes #3549.


I'm not sure that create --force <existing subdataset> is something we need to support, but I also don't see any harm in supporting it.

@@ -263,24 +263,25 @@ def __call__(
[text_type(c) for c in conflict])})
yield res
return
# another set of check to see whether the target path is pointing
Copy link
Contributor Author

@kyleam kyleam Jul 23, 2019

Aside from the first line, this hunk is just an increase in indentation level.

kyleam added 2 commits Jul 23, 2019
If create() is called with an existing subdataset as the path, we
abort saying that the subdataset is content in the parent dataset.
Although this is true, let's restrict this check to non-dataset
content (e.g., <existing subds>/<file>) and have the subdataset case
fall through to the "is subdataset?" check.  This will make it easier
to teach 'datalad create --force <existing subds>' to ignore the "is
subdataset?" check.

Re: datalad#3549
For top-level datasets, --force can be used to ignore the "is empty
directory?" check.  Make --force also disable the "is subdataset?"
check because this is consistent with the non-subdataset behavior and
was the behavior before the "rev-create -> create" rewrite.

Fixes datalad#3549.
@kyleam kyleam force-pushed the create-force-subds branch from a23f75e to be0ab2e Jul 23, 2019
@codecov
Copy link

@codecov codecov bot commented Jul 23, 2019

Codecov Report

Merging #3552 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3552      +/-   ##
=========================================
+ Coverage   82.99%     83%   +<.01%     
=========================================
  Files         272     272              
  Lines       35160   35169       +9     
=========================================
+ Hits        29182   29191       +9     
  Misses       5978    5978
Impacted Files Coverage Δ
datalad/distribution/tests/test_dataset.py 99.67% <ø> (ø) ⬆️
datalad/core/local/create.py 99.21% <100%> (ø) ⬆️
datalad/core/local/tests/test_create.py 100% <100%> (ø) ⬆️

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 ba66d1c...be0ab2e. Read the comment docs.

mih
mih approved these changes Jul 24, 2019
Copy link
Member

@mih mih left a comment

LGTM, thx!

@mih mih merged commit db8d723 into datalad:master Jul 24, 2019
5 checks passed
@kyleam kyleam deleted the create-force-subds branch Jul 24, 2019
@yarikoptic yarikoptic added this to the Release 0.12.0 milestone Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants