From 9fd2a1e5d816d7d5259cc9718f7f6ba8f99bed86 Mon Sep 17 00:00:00 2001 From: Christoph Otto Date: Wed, 29 Sep 2010 23:04:24 -0700 Subject: [PATCH] be a little more paranoid about db corruption --- github/github.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/github/github.py b/github/github.py index 42839b5..9fe6765 100644 --- a/github/github.py +++ b/github/github.py @@ -247,10 +247,12 @@ def processChangesetURL(self, req): i = commit_data[0] url = i['hash'] self.env.log.debug("mapping svn revision %s to github hash %s" % (svn_rev, url)); - else: + elif len(commit_data) == 0: self.env.log.debug("couldn't map svn revision %s", svn_rev); req.redirect(self.browser) - #XXX: fail gracefully if it doesn't exist + else: + self.env.log.debug("svn revision maps to multiple git commit ids. This shouldn't happen.") + req.redirect(self.browser) if not url: browser = self.browser