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/scm.py b/scm.py
index d920e9e..47a7c6e 100644
--- a/scm.py
+++ b/scm.py
@@ -567,7 +567,7 @@
# Warning: It's bad, it assumes args[2] is the directory
# argument.
if os.path.isdir(args[2]):
- gclient_utils.RemoveDirectory(args[2])
+ gclient_utils.rmtree(args[2])
else:
# Progress was made, convert to update since an aborted checkout
# is now an update.
@@ -856,7 +856,7 @@
buf.close()
return result
finally:
- gclient_utils.RemoveDirectory(bogus_dir)
+ gclient_utils.rmtree(bogus_dir)
@staticmethod
def _DiffItemInternal(filename, cwd, info, bogus_dir, full_move, revision):
@@ -1054,8 +1054,8 @@
logging.info('os.remove(%s)' % file_path)
os.remove(file_path)
elif os.path.isdir(file_path):
- logging.info('RemoveDirectory(%s)' % file_path)
- gclient_utils.RemoveDirectory(file_path)
+ logging.info('rmtree(%s)' % file_path)
+ gclient_utils.rmtree(file_path)
else:
logging.critical(
('No idea what is %s.\nYou just found a bug in gclient'