diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index e94f1559..bf640a2c 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -18,6 +18,9 @@ sub build : Chained('/') PathPart CaptureArgs(1) { $c->stash->{prevBuild} = getPreviousBuild($c, $c->stash->{build}); $c->stash->{prevSuccessfulBuild} = getPreviousSuccessfulBuild($c, $c->stash->{build}); + $c->stash->{mappers} = [$c->model('DB::UriRevMapper')->all]; + + notFound($c, "Build with ID $id doesn't exist.") if !defined $c->stash->{build}; diff --git a/src/root/common.tt b/src/root/common.tt index 4ddf8c16..d4b299a2 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -1,4 +1,5 @@ [% USE date %] +[% USE String %] [% USE HTML %] @@ -277,6 +278,22 @@ [% END %] [% END %] +[% BLOCK renderDiffUri; %] + [% nouri = 1 %] + [% FOREACH m IN mappers %] + [% base = m.baseuri %] + [% url = bi1.uri %] + [% path = url.replace(base, '') %] + [% IF url.match(base) %] + [% contents %] + [% nouri = 0 %] + [% END %] + [% END %] + [% IF nouri %] + [% contents %] + [% END %] +[% END %] + [% BLOCK renderInputDiff; %]
[% bi1.name %] | [% INCLUDE renderInputValue input=bi1 %] to [% INCLUDE renderInputValue input=bi2 %] | |
- [% bi1.name %] | Revision changed from [% bi1.revision %] to [% bi2.revision %]. + [% bi1.name %] | [% INCLUDE renderDiffUri contents=('Revision changed from ' _ bi1.revision _ ' to ' _ bi2.revision) %] |
diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 5cef92ee..dd096ca9 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -420,6 +420,11 @@ create table JobsetInputHashes ( foreign key (project, jobset) references Jobsets(project, name) on delete cascade on update cascade ); +create table UriRevMapper ( + baseuri text not null, + uri text not null, + primary key (baseuri) +); -- Some indices. create index IndexBuildInputsOnBuild on BuildInputs(build); |