changeset 23013:b50ed6b9b513

changectx: move `IndexError` handling in the top level try except This one can be handled by the top level catching.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 15 Oct 2014 16:14:50 -0700
parents bdb3349cf7ab
children f00813325c5a
files mercurial/context.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Wed Oct 15 16:05:24 2014 -0700
+++ b/mercurial/context.py	Wed Oct 15 16:14:50 2014 -0700
@@ -378,11 +378,7 @@
 
         try:
             if isinstance(changeid, int):
-                try:
-                    self._node = repo.changelog.node(changeid)
-                except IndexError:
-                    raise error.RepoLookupError(
-                        _("unknown revision '%s'") % changeid)
+                self._node = repo.changelog.node(changeid)
                 self._rev = changeid
                 return
             if isinstance(changeid, long):
@@ -463,8 +459,8 @@
                     changeid = hex(changeid)
             except TypeError:
                 pass
-        except Exception:
-            raise
+        except IndexError:
+            pass
         raise error.RepoLookupError(
             _("unknown revision '%s'") % changeid)