dvcignore: api to unhide subrepos directory#4324
Merged
Merged
Conversation
efiop
reviewed
Aug 4, 2020
efiop
reviewed
Aug 4, 2020
efiop
reviewed
Aug 4, 2020
Contributor
There was a problem hiding this comment.
I know that fstrings are better than format() , but there wasn't really a reason to change it in this PR 🙂
Collaborator
Author
There was a problem hiding this comment.
I had to change that before when I was experimenting with it. And, f-string is easy to read and understand (here, speed does not matter but could have been another reason), and therefore, I kept it.
efiop
reviewed
Aug 4, 2020
efiop
reviewed
Aug 4, 2020
I implemented this inside dvcignore, and it
should not require "internal" APIs hack as we discussed before.
Right now, `ignore_subrepos` will only work for the paths of subrepo,
not anything inside it. And the API user is more or less only
RepoTree, so should be safe (we switch DvcTree and repo.tree based
on path prefixes, so this is only required during `walk`, so as it
shows the repo that were previously dvcignored and so that we could
switch the trees later during walk.
So, if dir is `dir -> repo`
So, `tree.walk("dir")` will return `[]`,
whereas `tree.walk("dir", ignore_subrepos=False)` will return `["repo"]`
But, successive walk will just return `("repo", [], [])`, and could
just be ignored as a side-effect.
4e013e1 to
bc01116
Compare
efiop
approved these changes
Aug 10, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏
Part of #3369
I implemented this inside dvcignore, and it
should not require "internal" APIs hack as we discussed before.
Right now,
ignore_subreposwill only work for the paths of subrepo,not anything inside it. And the API user is more or less only
RepoTree, so should be safe (we switch DvcTree and repo.tree based
on path prefixes, so this is only required during
walk, so as itshows the repo that were previously dvcignored and so that we could
switch the trees later during walk.
So, if dir is
dir -> repoSo,
tree.walk("dir")will return[],whereas
tree.walk("dir", ignore_subrepos=False)will return["repo"]But, successive walk will just return
("repo", [], []), and couldjust be ignored as a side-effect.