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.
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
external: refactor external_repo() and its users #3190
external: refactor external_repo() and its users #3190
Changes from all commits
033ef88
9de0643
ee022ea
eb97e0b
72812b5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is
external_repo()
used if there's arev
? What if I want to access a file in the current DVC repo but from a previous commit?I'm trying to test this but I'm gettingAttributeError: module 'dvc' has no attribute 'api'
@Suor @skshetry @shcheklein
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jorgeorpinel, it should just clone the current repo and checkout to given
rev
and access that file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing this, I see it works anyway. But is it using
external_repo()
to clone the current repo in a temporary folder and then use that instead of just the current Git repo's tree?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p.s. my test script:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point is I think
Repo()
also acceptsrev
, just wondering why it's not passed, and whether that would be a better implementation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repo
does not acceptrev
. Repo is all about current workspace, so, you cannot just checkout the user's workspace and modify/read. So, even though it's still is aRepo
underneath (if it's a DVC repo), it's cloned, checked out to arev
, put into atmp
cache directory and operated inside of it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I was just confused by the name
external_repo
then. I guess that's the only way to get a previous rev from the current repo unfortunately.