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

Unified Diff: scm.py

Issue 2858003: Make scm.py work around even more with bad interaction better svn client and google code. (Closed)
Patch Set: past tense Created 10 years, 6 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 | no next file » | 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 23521b8d9cff59787322f7f99e818f9b7e105453..b577be5d4182194e1a21a9b440369ca6787f0d82 100644
--- a/scm.py
+++ b/scm.py
@@ -446,17 +446,46 @@ class SVN(object):
True,
CaptureMatchingLines)
except gclient_utils.Error:
- # We enforce that some progress has been made or HTTP 502.
- if (filter(lambda x: '502 Bad Gateway' in x, failure) or
- (len(failure) and len(file_list) > previous_list_len)):
- if args[0] == 'checkout':
- # An aborted checkout is now an update.
+ # Subversion client is really misbehaving with Google Code.
+ if args[0] == 'checkout':
+ # Ensure at least one file was checked out, otherwise *delete* the
+ # directory.
+ if len(file_list) == previous_list_len:
+ for x in failure:
+ if ('502 Bad Gateway' in x or
+ 'svn: REPORT of \'/svn/!svn/vcc/default\': 200 OK' in x):
+ # No file were checked out, so make sure the directory is
+ # deleted in case it's messed up and try again.
+ # Warning: It's bad, it assumes args[2] is the directory
+ # argument.
+ if os.path.isdir(args[2]):
+ chromium_utils.RemoveDirectory(args[2])
+ break
+ else:
+ # No known svn error was found, bail out.
+ raise
+ else:
+ # Progress was made, convert to update since an aborted checkout
+ # is now an update.
args = ['update'] + args[1:]
- print "Sleeping 15 seconds and retrying...."
- time.sleep(15)
- continue
- # No progress was made or an unknown error we aren't sure, bail out.
- raise
+ else:
+ # It was an update or export.
+ # We enforce that some progress has been made or HTTP 502.
+ if len(file_list) == previous_list_len:
+ for x in failure:
+ if ('502 Bad Gateway' in x or
+ 'svn: REPORT of \'/svn/!svn/vcc/default\': 200 OK' in x):
+ # Ok, know failure code.
+ break
+ else:
+ # No known svn error was found, bail out.
+ raise
+ else:
+ # Progress was made, it's fine.
+ pass
+ print "Sleeping 15 seconds and retrying...."
+ time.sleep(15)
+ continue
break
@staticmethod
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698