Skip to content

Commit

Permalink
erepo: set up more logging (#3403)
Browse files Browse the repository at this point in the history
  • Loading branch information
Suor authored Feb 26, 2020
1 parent b136eb5 commit d8778e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dvc/external_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,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 @@ -233,8 +234,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 @@ -246,6 +249,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

0 comments on commit d8778e7

Please sign in to comment.