From 86f0f95e378fc56ec18097b6b57fabee17c4207d Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Tue, 10 Aug 2010 17:17:19 +0000 Subject: [PATCH] Ignore unversioned files when switching a repository. Review URL: http://codereview.chromium.org/3132004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@55573 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gclient_scm.py b/gclient_scm.py index 925789db67..532fabc82e 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -793,11 +793,14 @@ class SVNWrapper(SCMWrapper): from_info['Repository Root'], to_info['Repository Root']) else: - if scm.SVN.CaptureStatus(checkout_path) and not options.force: - raise gclient_utils.Error("Can't switch the checkout to %s; UUID " - "don't match and there is local changes " - "in %s. Delete the directory and " - "try again." % (url, checkout_path)) + if not options.force: + # Look for local modifications but ignore unversioned files. + for status in scm.SVN.CaptureStatus(checkout_path): + if status[0] != '?': + raise gclient_utils.Error( + ('Can\'t switch the checkout to %s; UUID don\'t match and ' + 'there is local changes in %s. Delete the directory and ' + 'try again.') % (url, checkout_path)) # Ok delete it. print("\n_____ switching %s to a new checkout" % self.relpath) gclient_utils.RemoveDirectory(checkout_path)