Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1149)

Unified Diff: gclient.py

Issue 275103009: gclient: fix --delete_unversioned_trees bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: try GIT and SVn Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index 6147447da9d4bc80c8f755e99e51685ed761b575..3ac66e7639a12a0c75912130bdb970eb8e266a66 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1314,7 +1314,21 @@ want to set 'managed': False in .gclient.
prev_url, self.root_dir, entry_fixed, self.outbuf)
# Check to see if this directory is now part of a higher-up checkout.
- if scm.GetCheckoutRoot() in full_entries:
+ # The directory might be part of a git OR svn checkout.
+ scm_root = None
+ for scm_class in (gclient_scm.scm.GIT, gclient_scm.scm.SVN):
+ try:
+ scm_root = scm_class.GetCheckoutRoot(scm.checkout_path)
+ except subprocess2.CalledProcessError:
+ pass
+ if scm_root:
+ break
+ else:
+ logging.warning('Could not find checkout root for %s. Unable to '
+ 'determine whether it is part of a higher-level '
+ 'checkout, so not removing.' % entry)
+ continue
+ if scm_root in full_entries:
logging.info('%s is part of a higher level checkout, not '
'removing.', scm.GetCheckoutRoot())
continue
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698