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

Unified Diff: gclient_scm.py

Issue 6691034: First pass to transition away for gclient_utils.Error and gclient_utils.CheckedCallError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 months 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 | « gclient.py ('k') | scm.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 30e604dd7ebca84fef94e0d12f45ff2c19b0152d..6dc4da7f609ff0e65f8bd6d74f1c697645e6cd94 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -11,8 +11,9 @@ import re
import sys
import time
-import scm
import gclient_utils
+import scm
+import subprocess2
class DiffFilterer(object):
@@ -495,7 +496,7 @@ class GitWrapper(SCMWrapper):
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 @@ class SVNWrapper(SCMWrapper):
# 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 @@ class SVNWrapper(SCMWrapper):
# 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 @@ class SVNWrapper(SCMWrapper):
"""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):
« no previous file with comments | « gclient.py ('k') | scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698