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

Unified Diff: checkout.py

Issue 11649011: Add workaround where SVN.Revert() deletes the checkout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: fix comment Created 8 years 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: checkout.py
diff --git a/checkout.py b/checkout.py
index a303b338aca4d2b35ff0caea8c81f3536b8c39dd..e2e7e3ab9c97659b58814a35e3f363ae8fdd6281 100644
--- a/checkout.py
+++ b/checkout.py
@@ -479,15 +479,18 @@ class SvnCheckout(CheckoutBase, SvnMixIn):
flags = ['--ignore-externals']
if revision:
flags.extend(['--revision', str(revision)])
- if not os.path.isdir(self.project_path):
+ if os.path.isdir(self.project_path):
+ # This may remove any part (or all) of the checkout.
+ scm.SVN.Revert(self.project_path, no_ignore=True)
+
+ if os.path.isdir(self.project_path):
+ # Revive files that were deleted in scm.SVN.Revert().
+ self._check_call_svn(['update', '--force'] + flags)
+ else:
logging.info(
'Directory %s is not present, checking it out.' % self.project_path)
self._check_call_svn(
['checkout', self.svn_url, self.project_path] + flags, cwd=None)
- else:
- scm.SVN.Revert(self.project_path, no_ignore=True)
- # Revive files that were deleted in scm.SVN.Revert().
- self._check_call_svn(['update', '--force'] + flags)
return self._get_revision()
def _get_revision(self):
« 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