Commits

Dirkjan Ochtman  committed 1ce4809

Catch the right exception.

  • Participants
  • Parent commits 4a913e9

Comments (0)

Files changed (1)

File hgtl/changelog.py

 from trac.wiki.api import IWikiSyntaxProvider
 from trac.perm import IPermissionRequestor
 from trac.versioncontrol.web_ui.changeset import ITimelineEventProvider
-from trac.versioncontrol.api import NoSuchChangeset
 
 from mercurial import demandimport; demandimport.enable()
 from mercurial import hg, ui
+from mercurial.error import RepoLookupError
 demandimport.disable()
 
 class tracui(ui.ui):
 			ctx = hg.repository(self.ui, self.rpaths[ns])[rev]
 			text = shorten_line(to_unicode(ctx.description()))
 			return tag.a(label, class_='changeset', href=href, title=text)
-		except NoSuchChangeset, e:
+		except RepoLookupError as e:
 			return tag.a(label, class_='missing changeset', rel='nofollow',
 						 href=href, title=to_unicode(e))