changectx: move IndexError handling in the top level try except

This one can be handled by the top level catching.
This commit is contained in:
Pierre-Yves David 2014-10-15 16:14:50 -07:00
parent 4b3ae249b1
commit de4a821442

View File

@ -378,11 +378,7 @@ class changectx(basectx):
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 @@ class changectx(basectx):
changeid = hex(changeid)
except TypeError:
pass
except Exception:
raise
except IndexError:
pass
raise error.RepoLookupError(
_("unknown revision '%s'") % changeid)