comparison fetch_command.py @ 229:7f20914e52e8

Better 502 logic that does not catch non-502 errors.
author Augie Fackler <durin42@gmail.com>
date Tue, 31 Mar 2009 15:53:41 -0500
parents f71af18c4379
children 33e885f5f86a
comparison
equal deleted inserted replaced
228:f71af18c4379 229:7f20914e52e8
75 break 75 break
76 if valid: 76 if valid:
77 # got a 502? Try more than once! 77 # got a 502? Try more than once!
78 tries = 0 78 tries = 0
79 converted = False 79 converted = False
80 while not converted and tries < 3: 80 while not converted:
81 try: 81 try:
82 util.describe_revision(ui, r) 82 util.describe_revision(ui, r)
83 if have_replay: 83 if have_replay:
84 try: 84 try:
85 replay_convert_rev(hg_editor, svn, r) 85 replay_convert_rev(hg_editor, svn, r)
90 stupid_svn_server_pull_rev(ui, svn, hg_editor, r) 90 stupid_svn_server_pull_rev(ui, svn, hg_editor, r)
91 else: 91 else:
92 stupid_svn_server_pull_rev(ui, svn, hg_editor, r) 92 stupid_svn_server_pull_rev(ui, svn, hg_editor, r)
93 converted = True 93 converted = True
94 except core.SubversionException, e: #pragma: no cover 94 except core.SubversionException, e: #pragma: no cover
95 if e.apr_err == core.SVN_ERR_RA_DAV_REQUEST_FAILED: 95 if (e.apr_err == core.SVN_ERR_RA_DAV_REQUEST_FAILED
96 and '502' in str(e)
97 and tries < 3):
96 tries += 1 98 tries += 1
97 ui.status('Got a 502, retrying (%s)\n' % tries) 99 ui.status('Got a 502, retrying (%s)\n' % tries)
98 else: 100 else:
99 raise merc_util.Abort(*e.args) 101 raise merc_util.Abort(*e.args)
100 util.swap_out_encoding(old_encoding) 102 util.swap_out_encoding(old_encoding)