First pass to transition away for gclient_utils.Error and gclient_utils.CheckedCallError.
Make sure every site that catches gclient_utils.Error also catch
subprocess2.CalledProcessError.
BUG=
TEST=
Review URL: http://codereview.chromium.org/6691034
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80339 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_scm.py b/gclient_scm.py
index 30e604d..6dc4da7 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -11,8 +11,9 @@
import sys
import time
-import scm
import gclient_utils
+import scm
+import subprocess2
class DiffFilterer(object):
@@ -495,7 +496,7 @@
try:
self._Run(clone_cmd, options, cwd=self._root_dir)
break
- except gclient_utils.Error, e:
+ except (gclient_utils.Error, subprocess2.CalledProcessError), e:
# TODO(maruel): Hackish, should be fixed by moving _Run() to
# CheckCall().
# Too bad we don't have access to the actual output.
@@ -750,7 +751,7 @@
# Get the existing scm url and the revision number of the current checkout.
try:
from_info = scm.SVN.CaptureInfo(os.path.join(self.checkout_path, '.'))
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
raise gclient_utils.Error(
('Can\'t update/checkout %s if an unversioned directory is present. '
'Delete the directory and try again.') % self.checkout_path)
@@ -772,7 +773,7 @@
# The repository url changed, need to switch.
try:
to_info = scm.SVN.CaptureInfo(url)
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
# The url is invalid or the server is not accessible, it's safer to bail
# out right now.
raise gclient_utils.Error('This url is unreachable: %s' % url)
@@ -889,7 +890,7 @@
"""Display revision"""
try:
return scm.SVN.CaptureRevision(self.checkout_path)
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
return None
def runhooks(self, options, args, file_list):