Skip to content

utils: support use of (GitTree) tree file objects in utils #3819

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

Merged
merged 6 commits into from
May 19, 2020

Conversation

pmrowla
Copy link
Contributor

@pmrowla pmrowla commented May 19, 2020

  • ❗ 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. If the CLI API is changed, I have updated tab completion scripts.

  • ❌ I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Miscellaneous improvements to GitTree and utils that will be needed for cache/repo tree changes.

Related to #3811.

@pmrowla pmrowla self-assigned this May 19, 2020
@pmrowla pmrowla force-pushed the git-tree-extensions branch from 25e4406 to e8ec3da Compare May 19, 2020 05:00
@@ -202,6 +198,12 @@ def copyfile(src, dest, no_progress_bar=False, name=None):
fdest_wrapped.write(buf)


def copy_fobj_to_file(fsrc, dest):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will probably want progress bar support for this once we are saving files from git tree to local cache, but I think it may make more sense to have the pbar instance in the higher level save() method.

So at that point we can add a pbar update callback parameter to this method (and do buffered read/write instead of using shutil.copyfileobj as needed).

@pmrowla pmrowla requested review from pared, efiop and skshetry May 19, 2020 05:15
@efiop efiop merged commit b88b3b8 into iterative:master May 19, 2020
@pmrowla pmrowla deleted the git-tree-extensions branch May 19, 2020 13:22
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.

3 participants