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

Unified Diff: gclient_scm.py

Issue 3307016: Change scm.SVN.Capture (Closed)
Patch Set: patchset 4 was wrong Created 10 years, 3 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 | « no previous file | scm.py » ('j') | tests/gclient_scm_test.py » ('J')
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 3c39729e24d3e8dadb0f537691eeed4257739060..7b8e238e495e617cfca3473b16c50e93246d8301 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -742,12 +742,12 @@ class SVNWrapper(SCMWrapper):
return
# Get the existing scm url and the revision number of the current checkout.
- from_info = scm.SVN.CaptureInfo(os.path.join(self.checkout_path, '.'), '.')
- if not from_info:
- raise gclient_utils.Error(('Can\'t update/checkout %r if an unversioned '
- 'directory is present. Delete the directory '
- 'and try again.') %
- self.checkout_path)
+ try:
+ from_info = scm.SVN.CaptureInfo(os.path.join(self.checkout_path, '.'))
+ except gclient_utils.Error:
+ raise gclient_utils.Error(
+ ('Can\'t update/checkout %s if an unversioned directory is present. '
+ 'Delete the directory and try again.') % self.checkout_path)
# Look for locked directories.
dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.'))
@@ -758,14 +758,15 @@ class SVNWrapper(SCMWrapper):
# Retrieve the current HEAD version because svn is slow at null updates.
if options.manually_grab_svn_rev and not revision:
- from_info_live = scm.SVN.CaptureInfo(from_info['URL'], '.')
+ from_info_live = scm.SVN.CaptureInfo(from_info['URL'])
revision = str(from_info_live['Revision'])
rev_str = ' at %s' % revision
if from_info['URL'] != base_url:
# The repository url changed, need to switch.
- to_info = scm.SVN.CaptureInfo(url, '.')
- if not to_info.get('Repository Root') or not to_info.get('UUID'):
+ try:
+ to_info = scm.SVN.CaptureInfo(url)
+ except gclient_utils.Error:
# 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)
@@ -919,7 +920,10 @@ class SVNWrapper(SCMWrapper):
def revinfo(self, options, args, file_list):
"""Display revision"""
- return scm.SVN.CaptureBaseRevision(self.checkout_path)
+ try:
+ return scm.SVN.CaptureRevision(self.checkout_path)
+ except gclient_utils.Error:
+ return None
def runhooks(self, options, args, file_list):
self.status(options, args, file_list)
« no previous file with comments | « no previous file | scm.py » ('j') | tests/gclient_scm_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698