changeset 5113:792c1d979097

Replace _ with inst for catching exceptions to not shadow gettext. And removed one _(...) because mercurial.i18n is not yet imported in convert/subversion.py.
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 07 Aug 2007 09:56:21 +0200
parents 18abf13064cb
children bcf6ba3fcbe4
files hgext/convert/subversion.py hgext/convert/transport.py
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -77,7 +77,7 @@ def get_log_child(fp, url, paths, start,
                        discover_changed_paths,
                        strict_node_history,
                        receiver)
-    except SubversionException, (_, num):
+    except SubversionException, (inst, num):
         pickle.dump(num, fp, protocol)
     else:
         pickle.dump(None, fp, protocol)
@@ -190,8 +190,7 @@ class convert_svn(converter_source):
                 self.ui.note('found branch %s at %d\n' % (branch, brevnum))
                 self.heads.append(brev)
         elif cfgtrunk or cfgbranches:
-            raise util.Abort(_('trunk/branch layout expected, '
-                               'but not found'))
+            raise util.Abort('trunk/branch layout expected, but not found')
         else:
             self.ui.note('working with one branch\n')
             self.heads = [self.head]
@@ -269,7 +268,7 @@ class convert_svn(converter_source):
                     rev = ent.copyfrom_rev
                     tag = path.split('/', 2)[2]
                     tags[tag] = self.revid(rev, module=source)
-        except SubversionException, (_, num):
+        except SubversionException, (inst, num):
             self.ui.note('no tags found at revision %d\n' % start)
         return tags
 
@@ -607,7 +606,7 @@ class convert_svn(converter_source):
                     self.ui.debug('revision %d has no entries\n' % revnum)
                     continue
                 parselogentry(orig_paths, revnum, author, date, message)
-        except SubversionException, (_, num):
+        except SubversionException, (inst, num):
             if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION:
                 raise NoSuchRevision(branch=self,
                     revision="Revision number %d" % to_revnum)
--- a/hgext/convert/transport.py
+++ b/hgext/convert/transport.py
@@ -81,7 +81,7 @@ class SvnRaTransport(object):
                 self.ra = svn.client.open_ra_session(
                     self.svn_url.encode('utf8'),
                     self.client, self.pool)
-            except SubversionException, (_, num):
+            except SubversionException, (inst, num):
                 if num in (svn.core.SVN_ERR_RA_ILLEGAL_URL,
                            svn.core.SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED,
                            svn.core.SVN_ERR_BAD_URL):