comparison svnwrap/svn_swig_wrapper.py @ 224:2165461d2dd8

Exception clean-ups; use symbolic names & avoid Python 2.6 deprecations.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 19 Mar 2009 21:27:39 +0100
parents 77812f98e250
children f71af18c4379
comparison
equal deleted inserted replaced
212:a421aca2b0f5 224:2165461d2dd8
187 187
188 def tags_at_rev(self, revision): 188 def tags_at_rev(self, revision):
189 try: 189 try:
190 tags = self.list_dir('tags', revision=revision).keys() 190 tags = self.list_dir('tags', revision=revision).keys()
191 except core.SubversionException, e: 191 except core.SubversionException, e:
192 if e.apr_err == 160013: 192 if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
193 return {} 193 return {}
194 raise 194 raise
195 tag_info = {} 195 tag_info = {}
196 for t in tags: 196 for t in tags:
197 tag_info[t] = self._get_copy_source('tags/%s' % t, 197 tag_info[t] = self._get_copy_source('tags/%s' % t,
384 try: 384 try:
385 ra.replay(self.ra, revision, oldest_rev_i_have, True, e_ptr, 385 ra.replay(self.ra, revision, oldest_rev_i_have, True, e_ptr,
386 e_baton, self.pool) 386 e_baton, self.pool)
387 except core.SubversionException, e: #pragma: no cover 387 except core.SubversionException, e: #pragma: no cover
388 # can I depend on this number being constant? 388 # can I depend on this number being constant?
389 if (e.message == "Server doesn't support the replay command" 389 if (e.apr_err == core.SVN_ERR_RA_NOT_IMPLEMENTED or
390 or e.apr_err == 170003 390 e.apr_err == core.SVN_ERR_UNSUPPORTED_FEATURE):
391 or e.message == 'The requested report is unknown.'
392 or e.apr_err == 200007):
393 raise SubversionRepoCanNotReplay, ('This Subversion server ' 391 raise SubversionRepoCanNotReplay, ('This Subversion server '
394 'is older than 1.4.0, and cannot satisfy replay requests.') 392 'is older than 1.4.0, and cannot satisfy replay requests.')
395 else: 393 else:
396 raise 394 raise
397 395