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

Unified Diff: 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_scm.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
diff --git a/scm.py b/scm.py
index 4dc27d081fd852a8057e0aa85ed823f1144c0564..f0fa40fcb8b4500cd3084a13b3121ee6697227f8 100644
--- a/scm.py
+++ b/scm.py
@@ -17,6 +17,8 @@ import time
import xml.dom.minidom
import gclient_utils
+import subprocess2
+
def ValidateEmail(email):
return (re.match(r"^[a-zA-Z0-9._%-+]+@[a-zA-Z0-9._%-]+.[a-zA-Z]{2,6}$", email)
@@ -270,25 +272,25 @@ class GIT(object):
try:
upstream_branch = GIT.Capture(
['config', 'branch.%s.merge' % branch], cwd=cwd).strip()
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
upstream_branch = None
if upstream_branch:
try:
remote = GIT.Capture(
['config', 'branch.%s.remote' % branch], cwd=cwd).strip()
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
pass
else:
try:
upstream_branch = GIT.Capture(
['config', 'rietveld.upstream-branch'], cwd=cwd).strip()
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
upstream_branch = None
if upstream_branch:
try:
remote = GIT.Capture(
['config', 'rietveld.upstream-remote'], cwd=cwd).strip()
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
pass
else:
# Fall back on trying a git-svn upstream branch.
@@ -459,7 +461,7 @@ class SVN(object):
always=verbose,
filter_fn=CaptureMatchingLines,
stdout=stdout)
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
def IsKnownFailure():
for x in failure:
if (x.startswith('svn: OPTIONS of') or
@@ -659,7 +661,7 @@ class SVN(object):
"""
try:
return SVN.Capture(['propget', property_name, filename])
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
return ''
@staticmethod
@@ -840,7 +842,7 @@ class SVN(object):
"""Retrieves the svn account which we assume is an email address."""
try:
infos = SVN.CaptureInfo(repo_root)
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
return None
# Should check for uuid but it is incorrectly saved for https creds.
@@ -902,7 +904,7 @@ class SVN(object):
info = SVN.CaptureInfo(directory)
cur_dir_repo_root = info['Repository Root']
url = info['URL']
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
return None
while True:
parent = os.path.dirname(directory)
@@ -912,7 +914,7 @@ class SVN(object):
info['URL'] != os.path.dirname(url)):
break
url = info['URL']
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
break
directory = parent
return GetCasedPath(directory)
« no previous file with comments | « gclient_scm.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698