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

erepo: set up more logging #3403

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dvc/external_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def _cached_clone(url, rev, for_write=False):

# Copy to a new dir to keep the clone clean
repo_path = tempfile.mkdtemp("dvc-erepo")
logger.debug("erepo: making a copy of {} clone", url)
copy_tree(clone_path, repo_path)

# Check out the specified revision
Expand All @@ -219,8 +220,10 @@ def _clone_default_branch(url, rev):
git = Git(clone_path)
# Do not pull for known shas, branches and tags might move
if not Git.is_sha(rev) or not git.has_rev(rev):
logger.debug("erepo: git pull {}", url)
git.pull()
else:
logger.debug("erepo: git clone {} to a temporary dir", url)
clone_path = tempfile.mkdtemp("dvc-clone")
git = Git.clone(url, clone_path)
CLONES[url] = clone_path
Expand All @@ -232,6 +235,7 @@ def _clone_default_branch(url, rev):


def _git_checkout(repo_path, rev):
logger.debug("erepo: git checkout {}@{}", repo_path, rev)
git = Git(repo_path)
try:
git.checkout(rev)
Expand Down