Merge "Don't try to remove .repo if it doesn't exist"

This commit is contained in:
David Pursehouse 2014-04-18 00:06:07 +00:00 committed by Gerrit Code Review
commit 5a7c3afa73

8
repo
View File

@ -114,6 +114,7 @@ import errno
import optparse import optparse
import os import os
import re import re
import shutil
import stat import stat
import subprocess import subprocess
import sys import sys
@ -741,12 +742,7 @@ def main(orig_args):
try: try:
_Init(args) _Init(args)
except CloneFailure: except CloneFailure:
for root, dirs, files in os.walk(repodir, topdown=False): shutil.rmtree(repodir, ignore_errors=True)
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
os.rmdir(os.path.join(root, name))
os.rmdir(repodir)
sys.exit(1) sys.exit(1)
repo_main, rel_repo_dir = _FindRepo() repo_main, rel_repo_dir = _FindRepo()
else: else: