-
Notifications
You must be signed in to change notification settings - Fork 1.3k
SCM: allow multiple DVC repos inside single SCM repo #3257
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,10 +71,25 @@ def __eq__(self, other): | |
| return self.basenames == other.basenames | ||
|
|
||
|
|
||
| class DvcIgnoreRepo(DvcIgnore): | ||
| def __call__(self, root, dirs, files): | ||
| def is_dvc_repo(directory): | ||
| from dvc.repo import Repo | ||
|
|
||
| return os.path.isdir(os.path.join(directory, Repo.DVC_DIR)) | ||
|
|
||
| dirs = [d for d in dirs if not is_dvc_repo(d)] | ||
|
|
||
| return dirs, files | ||
|
|
||
|
|
||
| class DvcIgnoreFilter(object): | ||
| def __init__(self, tree): | ||
| self.tree = tree | ||
| self.ignores = {DvcIgnoreDirs([".git", ".hg", ".dvc"])} | ||
| self.ignores = { | ||
| DvcIgnoreDirs([".git", ".hg", ".dvc"]), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .hg ? Do we support Mercurial somehow now??? Or is this legacy stuff? Thanks
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't want to traverse through
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm... Why only do this for .hg? There's many many possible files or dirs the user may want to gitignore and they can just add it to .gitignore/ or .git/info/exclude
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jorgeorpinel add An alternative would be to add
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Haha sorry I wasn't thinking right π
Yeah, this! Since we don't support Mercurial in general why treat it specially? I'd let the user handle it, like he could want dvcignore any other files or directories for a bunch of reasons.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think this is the case @skshetry. It's just kind of a legacy option name AFAIK. Refer to #2901.
You'd be surprised.
@shcheklein I don't even see this. DVC ignores .git/ automatically because it integrates with Git. I don't see a reason to treat any other file/dir name specially. In summary, I vote to remove the 7 characters we're talking about, but I realize this is probably a moot point since no one even uses Mercurial anymore haha.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jorgeorpinel, I think something good thing to do is in middle. If people have a certain directories such as
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree about improving .dvcignore awareness. (I think the warning may exist BTW?) For docs, I opened treeverse/dvc.org/issues/1033.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
it's a really good idea. Please create an issue for this in the DVC core repo. I still don't see a reason to include
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created #3436 |
||
| DvcIgnoreRepo(), | ||
| } | ||
| for root, dirs, files in self.tree.walk(self.tree.tree_root): | ||
| self._update(root) | ||
| dirs[:], files[:] = self(root, dirs, files) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.