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

BF: get: Inherit reckless configuration when cloning subdatasets #4657

Merged
merged 1 commit into from Jun 25, 2020

Conversation

kyleam
Copy link
Collaborator

@kyleam kyleam commented Jun 24, 2020

Cloning a subdataset is supposed to inherit the parent's
`datalad.clone.reckless` value.  This works as intended when using
install() to get an existing dataset or using clone() to create a new
subdataset, but the parent's configuration is ignored when the clone
is triggered by get().

The "inherit reckless" logic is handled in Clone.__call__(), but
that's upstream of clone_dataset(), where get() hooks into.  Move the
handling into clone_dataset() to avoid repeating it in get().

Note that we don't have access to the parent dataset in
clone_dataset(), but we need to query its configuration.  We could add
the parent dataset as a parameter.  However, there's already a cfg
parameter, and Clone.__call__()---the only caller that specifies
cfg---passes the parent's configuration.  So instead just update get()
to pass in cfg and query that, adjusting the documentation to note
that cfg should be the parent's.

Closes #4655.

Cloning a subdataset is supposed to inherit the parent's
`datalad.clone.reckless` value.  This works as intended when using
install() to get an existing dataset or using clone() to create a new
subdataset, but the parent's configuration is ignored when the clone
is triggered by get().

The "inherit reckless" logic is handled in Clone.__call__(), but
that's upstream of clone_dataset(), where get() hooks into.  Move the
handling into clone_dataset() to avoid repeating it in get().

Note that we don't have access to the parent dataset in
clone_dataset(), but we need to query its configuration.  We could add
the parent dataset as a parameter.  However, there's already a cfg
parameter, and Clone.__call__()---the only caller that specifies
cfg---passes the parent's configuration.  So instead just update get()
to pass in cfg and query that, adjusting the documentation to note
that cfg should be the parent's.

Closes datalad#4655.
@kyleam
Copy link
Collaborator Author

kyleam commented Jun 24, 2020

The failing appveyor builds are due to a codecov issue (where a good chunk of the error message is helpfully reported one character per line).

mih
mih approved these changes Jun 25, 2020
Copy link
Member

@mih mih left a comment

It looked good, and it worked when I tried it. Thx much!

@mih mih merged commit 1a2efe6 into datalad:maint Jun 25, 2020
8 of 10 checks passed
@kyleam kyleam deleted the get-inherit-reckless branch Jun 25, 2020
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 this pull request may close these issues.

None yet

2 participants