[jhbuild] [buildbot] don't fail on Change objects that do not have git module



commit 1bdd02341b8927cf720e7592ca9a2a7af2d54c8c
Author: Frédéric Péters <fpeters 0d be>
Date:   Mon Jan 10 11:56:39 2011 +0100

    [buildbot] don't fail on Change objects that do not have git module

 jhbuild/buildbot/status/web/changes.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/buildbot/status/web/changes.py b/jhbuild/buildbot/status/web/changes.py
index bb97dee..421655b 100644
--- a/jhbuild/buildbot/status/web/changes.py
+++ b/jhbuild/buildbot/status/web/changes.py
@@ -71,10 +71,14 @@ class ChangeResource(HtmlResource):
         if self.change.revision:
             if len(self.change.revision) == 40:
                 # git commit
+                if hasattr(self.change, 'git_module_name'):
+                    git_module_name = self.change.git_module_name
+                else:
+                    git_module_name = self.change.project
                 link = 'http://git.gnome.org/browse/%s/commit/?id=%s' % (
-                        self.change.git_module_name, self.change.revision)
+                        git_module_name, self.change.revision)
                 data += '<p>View in GNOME cgit: <a href="%s">%s commit %s</a></dd>\n' % (
-                        link, self.change.git_module_name, self.change.revision[:8])
+                        link, git_module_name, self.change.revision[:8])
             else:
                 link = 'http://svn.gnome.org/viewvc/%s?view=revision&revision=%s' % (
                         self.change.project, self.change.revision)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]