[SCM] build.samba.org - branch master updated
Jelmer Vernooij
jelmer at samba.org
Thu Nov 18 15:02:49 MST 2010
The branch, master has been updated
via 0195c00 Ignore some files.
via 7bf5fcd use pygments for prettyfying diffs.
via acd1742 remove more unicode references.
from 088d389 Add id column to host.
http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 0195c002cd14bbd3f9efac6a8c8a0308aa47dfe2
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Nov 18 23:01:48 2010 +0100
Ignore some files.
commit 7bf5fcd30310ab85a77b1acd2428988e49a52f81
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Nov 18 22:28:17 2010 +0100
use pygments for prettyfying diffs.
commit acd174211603083bc9072073a00e360d0445289d
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Wed Nov 17 11:53:03 2010 +0100
remove more unicode references.
-----------------------------------------------------------------------
Summary of changes:
.bzrignore | 2 ++
buildfarm/web/__init__.py | 31 +++++++------------------------
import-and-analyse.py | 4 +---
3 files changed, 10 insertions(+), 27 deletions(-)
Changeset truncated at 500 lines:
diff --git a/.bzrignore b/.bzrignore
index a34bfd1..678f66f 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1,3 +1,5 @@
hostdb.sqlite
_trial_temp
db
+cache
+data
diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py
index 3d091a4..f33453b 100755
--- a/buildfarm/web/__init__.py
+++ b/buildfarm/web/__init__.py
@@ -26,6 +26,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+"""Buildfarm web frontend."""
+
# TODO: Allow filtering of the "Recent builds" list to show
# e.g. only broken builds or only builds that you care about.
@@ -42,13 +44,15 @@ from buildfarm.filecache import (
)
import cgi
+from pygments import highlight
+from pygments.lexers.text import DiffLexer
+from pygments.formatters import HtmlFormatter
import re
import time
import wsgiref.util
webdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "web"))
-
GITWEB_BASE = "http://gitweb.samba.org"
HISTORY_HORIZON = 1000
@@ -322,28 +326,7 @@ def make_collapsible_html(type, title, output, id, status=""):
def diff_pretty(diff):
"""pretty up a diff -u"""
- # FIXME: JRV 20101109 Use pygments for this
- ret = ""
- lines = diff.splitlines()
-
- line_types = {
- 'diff': 'diff_diff',
- '=': 'diff_separator',
- 'Index:': 'diff_index',
- 'index': 'diff_index',
- '-': 'diff_removed',
- '+': 'diff_added',
- '@@': 'diff_fragment_header'
- }
-
- for line in lines:
- for r, cls in line_types.iteritems():
- if line.startswith(r):
- line = "<span class=\"%s\">%s</span>" % (cls, line)
- continue
- ret += line + "\n"
-
- return ret
+ return highlight(diff, DiffLexer(), HtmlFormatter())
def web_paths(t, paths):
@@ -747,7 +730,7 @@ class ViewHostPage(BuildFarmPage):
yield "<tbody>"
for host in deadhosts:
- age_ctime = self.buildfarm.hostdb.host_age(host)
+ age_ctime = self.buildfarm.host_age(host)
yield "<tr><td>%s</td><td>%s</td><td>%s</td></tr>" %\
(host, self.buildfarm.hostdb.host(host).platform.encode("utf-8"),
util.dhm_time(age_ctime))
diff --git a/import-and-analyse.py b/import-and-analyse.py
index f6f0c2c..ee389df 100755
--- a/import-and-analyse.py
+++ b/import-and-analyse.py
@@ -70,9 +70,7 @@ The build may have been broken by one of the following commits:
%(change_log)s
""" % {
- "tree": tree.encode("utf-8"),
- "host": host.encode("utf-8"),
- "compiler": compiler.encode("utf-8"),
+ "tree": tree, "host": host, "compiler": compiler,
"change_log": change_log,
"scm": t.scm,
"branch": t.branch,
--
build.samba.org
More information about the samba-cvs
mailing list