# HG changeset patch # User Augie Fackler # Date 1238532821 18000 # Node ID 7f20914e52e86b81a99d08f73973ec5dbc42ab89 # Parent f71af18c4379aeb262006bbef1c4cf6b87d63d72 Better 502 logic that does not catch non-502 errors. diff --git a/fetch_command.py b/fetch_command.py --- a/fetch_command.py +++ b/fetch_command.py @@ -77,7 +77,7 @@ def fetch_revisions(ui, svn_url, hg_repo # got a 502? Try more than once! tries = 0 converted = False - while not converted and tries < 3: + while not converted: try: util.describe_revision(ui, r) if have_replay: @@ -92,7 +92,9 @@ def fetch_revisions(ui, svn_url, hg_repo stupid_svn_server_pull_rev(ui, svn, hg_editor, r) converted = True except core.SubversionException, e: #pragma: no cover - if e.apr_err == core.SVN_ERR_RA_DAV_REQUEST_FAILED: + if (e.apr_err == core.SVN_ERR_RA_DAV_REQUEST_FAILED + and '502' in str(e) + and tries < 3): tries += 1 ui.status('Got a 502, retrying (%s)\n' % tries) else: