changeset 5140: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	Tue Aug 07 09:49:07 2007 +0200
+++ b/hgext/convert/subversion.py	Tue Aug 07 09:56:21 2007 +0200
@@ -77,7 +77,7 @@
                        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 @@
                 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 @@
                     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 @@
                     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	Tue Aug 07 09:49:07 2007 +0200
+++ b/hgext/convert/transport.py	Tue Aug 07 09:56:21 2007 +0200
@@ -81,7 +81,7 @@
                 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):