Remove gclient_utils.RemoveDirectory().
The 'RemoveDirectory()' function in gclient_utils is deprecated and
rmtree() should be used instead for consistency.
This patch modifies all clients in depot_tools to use rmtree() instead
and removes the RemoveDirectory function.
+ The SVNWrapperTestCase.testRevertNoDotSvn() mocking
expectation has been slightly changed. This was required
because the test invokes code that used to call
gclient_utils.RemoveDirectory() directly, while only
gclient_utils.rmtree() was mocked.
BUG=NONE
R=maruel@chromium.org, ilevy@chromium.org
TEST=manually run gclient_utils_test / gclient_smoketest / scm_unittest / gclient_scm_test
Review URL: https://chromiumcodereview.appspot.com/14134010
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@196133 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_scm.py b/gclient_scm.py
index 71fecd0..4573a48 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -526,7 +526,7 @@
full_path = os.path.join(self.checkout_path, path)
if not os.path.islink(full_path):
print('\n_____ removing unversioned directory %s' % path)
- gclient_utils.RemoveDirectory(full_path)
+ gclient_utils.rmtree(full_path)
def revert(self, options, args, file_list):
@@ -1080,7 +1080,7 @@
'try again.') % (url, self.checkout_path))
# Ok delete it.
print('\n_____ switching %s to a new checkout' % self.relpath)
- gclient_utils.RemoveDirectory(self.checkout_path)
+ gclient_utils.rmtree(self.checkout_path)
# We need to checkout.
command = ['checkout', url, self.checkout_path]
command = self._AddAdditionalUpdateFlags(command, options, revision)
@@ -1106,7 +1106,7 @@
and os.path.isdir(full_path)
and not os.path.islink(full_path)):
print('\n_____ removing unversioned directory %s' % status[1])
- gclient_utils.RemoveDirectory(full_path)
+ gclient_utils.rmtree(full_path)
def updatesingle(self, options, args, file_list):
filename = args.pop()