# HG changeset patch # User osimons # Date 1265910202 0 # Node ID 440b48bba3e9b53f2ccda4af72ed3c9b851e3b90 # Parent df8d2cd7e50e31b87aaea694b45133d87d7da1e6 Merged [806:809] from trunk. diff --git a/bitten/build/hgtools.py b/bitten/build/hgtools.py --- a/bitten/build/hgtools.py +++ b/bitten/build/hgtools.py @@ -18,11 +18,10 @@ """ args = ['pull', '-u'] if revision: - args += ['-r', revision.split(':')[0]] - args += [dir_] + args += ['-r', revision.split(':')[1]] from bitten.build import shtools - returncode = shtools.execute(ctxt, file_='hg', args=args) + returncode = shtools.execute(ctxt, file_='hg', args=args, dir_=dir_) if returncode != 0: ctxt.error('hg pull -u failed (%s)' % returncode) diff --git a/bitten/build/javatools.py b/bitten/build/javatools.py --- a/bitten/build/javatools.py +++ b/bitten/build/javatools.py @@ -135,7 +135,7 @@ # Sometimes the traceback isn't prefixed with the # exception type and message, so add it in if needed tracebackprefix = "%s: %s" % (result[0].attr['type'], - result[0].attr['message']) + result[0].attr.get('message', '')) if result[0].gettext().startswith(tracebackprefix): test.append(xmlio.Element('traceback')[ result[0].gettext()]) diff --git a/bitten/main.py b/bitten/main.py --- a/bitten/main.py +++ b/bitten/main.py @@ -18,6 +18,7 @@ from trac.env import IEnvironmentSetupParticipant from trac.perm import IPermissionRequestor from trac.resource import IResourceManager +from trac.util.html import escape from trac.wiki import IWikiSyntaxProvider from bitten.api import IBuildListener from bitten.model import schema, schema_version, Build, BuildConfig @@ -100,6 +101,9 @@ def get_link_resolvers(self): def _format_link(formatter, ns, name, label): + segments = name.split('#') + name = segments[0] + step = len(segments) == 2 and segments[1] or '' try: name = int(name) except ValueError: @@ -109,9 +113,13 @@ config = BuildConfig.fetch(self.env, build.config) title = 'Build %d ([%s] of %s) by %s' % (build.id, build.rev, config.label, build.slave) + if step: + if not step.startswith('step_'): + step = 'step_' + step + step = '#' + escape(step) return '%s' \ - % (formatter.href.build(build.config, build.id), title, - label) + % (formatter.href.build(build.config, build.id) + step, + title, label) return label yield 'build', _format_link diff --git a/doc/links.txt b/doc/links.txt --- a/doc/links.txt +++ b/doc/links.txt @@ -6,5 +6,9 @@ Bitten supports the ability to link between any wiki-enabled objects in Trac. -To link to a particular build, use the TracLink syntax ``build:N`` (where ``N`` is the number of the build) - +To link to a particular build, use the TracLink syntax ``build:N`` +(where ``N`` is the number of the build). + +Linking to a particular step of the build is also supported by adding an +anchor reference, like ``build:N#Test``. If the step ID contains spaces, +the link must be quoted: ``build:"N#My Step"``.