diff --git a/src/lib/Hydra/Schema/Result/JobsetEvalInputs.pm b/src/lib/Hydra/Schema/Result/JobsetEvalInputs.pm index b3a0cf7e..acde8b43 100644 --- a/src/lib/Hydra/Schema/Result/JobsetEvalInputs.pm +++ b/src/lib/Hydra/Schema/Result/JobsetEvalInputs.pm @@ -183,4 +183,20 @@ sub json_hint { return \%hint; } +# Revision to be rendered by the frontend +sub frontend_revision() { + my ($self) = @_; + my $type = $self->get_column('type'); + if ($type eq 'svn' or $type eq 'svn-checkout' or $type eq 'bzr' or $type eq 'bzr-checkout') { + return 'r' . $self->get_column('revision'); + } elsif ($type eq 'git') { + return substr($self->get_column('revision'), 0, 12); + } elsif ($type eq 'bzr') { + return substr($self->get_column('revision'), 0, 12); + } else { + return $self->get_column('revision'); + } + +} + 1; diff --git a/src/root/common.tt b/src/root/common.tt index b18d33f7..65fbf90b 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -411,7 +411,7 @@ BLOCK renderInputDiff; %] [% ELSIF bi1.uri == bi2.uri && bi1.revision != bi2.revision %] [% IF bi1.type == "git" %] - [% HTML.escape(bi1.name) %][% INCLUDE renderDiffUri contents=(bi1.revision.substr(0, 12) _ ' to ' _ bi2.revision.substr(0, 12)) %] + [% HTML.escape(bi1.name) %][% INCLUDE renderDiffUri contents=(bi1.frontend_revision _ ' to ' _ bi2.frontend_revision) %] [% ELSE %] @@ -452,16 +452,10 @@ BLOCK renderPager %] BLOCK renderShortEvalInput; - IF input.type == "svn" || input.type == "svn-checkout" || input.type == "bzr" || input.type == "bzr-checkout" %] - r[% input.revision %] - [% ELSIF input.type == "git" %] - [% input.revision.substr(0, 7) | html %] - [% ELSIF input.type == "hg" %] - [% input.revision.substr(0, 12) | html %] - [% ELSIF input.type == "build" || input.type == "sysbuild" %] + IF input.type == "build" || input.type == "sysbuild" %] c.uri_for('/build' input.get_column('dependency'))) %]>[% HTML.escape(input.get_column('dependency')) %] [% ELSE %] - [% input.revision | html %] + [% input.frontend_revision | html %] [% END; END; diff --git a/src/root/reproduce.tt b/src/root/reproduce.tt index d8a77518..8d44d8f3 100644 --- a/src/root/reproduce.tt +++ b/src/root/reproduce.tt @@ -117,7 +117,7 @@ else revCount="$(cat "$tmpDir/[% input.name %]/rev-count")" fi -args+=(--arg '[% input.name %]' "{ outPath = $inputDir; rev = \"[% input.revision %]\"; shortRev = \"[% input.revision.substr(0, 7) %]\"; revCount = $revCount; }") +args+=(--arg '[% input.name %]' "{ outPath = $inputDir; rev = \"[% input.revision %]\"; shortRev = \"[% input.frontend_revision %]\"; revCount = $revCount; }") [%+ ELSIF input.type == "hg" %]