hydra: when no external url is given for diff's of git/hg input, revert to a diff done on a local available clone

[?]
Aug 25, 2011, 2:50 PM
SHYRGAWZFYGRWCRB54TYL2GTU3B4WMQ3J5H4ZHGV27W7PUQN3EWQC

Dependencies

  • [2] BKOIYITR added some json responses
  • [3] MBNX3V52 hydra: disallow robots.txt for root and project all builds page
  • [4] OSVLMLCQ hydra: factored out build restart and
  • [5] O25D52TA initial support for mercurial
  • [6] JI26P3PC hydra: export addBuildProducts
  • [7] A22P7HCO hydra: at evaluation, check if path is already built, and mark as built in stead of adding to the queue.
  • [8] KAZWI5G4 * hydra: buildpage, show changes since last build/successful build
  • [9] 5SHCWE7X * Prevent repeated evaluation of a jobset with the same inputs. This
  • [10] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate
  • [11] QBQSQOSY hydra: moved getbuildlog
  • [12] 3XTHEUMP * Implemented the clone feature.
  • [13] 2M7J26V4 inital version of links to diff in scm
  • [14] SGNXIOI4 Hydra/32: Add option to force evaluation of a certain jobset via web interface (for admins only)
  • [15] ZI535LI6 * hydra: 'new' UI for project/jobset/job/build
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] IK53RV4V

Change contents

  • edit in src/lib/Hydra/Controller/API.pm at line 7
    [2.141]
    [2.141]
    use Hydra::Helper::AddBuilds;
  • edit in src/lib/Hydra/Controller/API.pm at line 12
    [2.236]
    [2.236]
    use Digest::SHA qw(sha256_hex);
  • edit in src/lib/Hydra/Controller/API.pm at line 208
    [2.6097]
    [2.6097]
    $c->forward('Hydra::View::Plain');
    }
    sub scmdiff : Chained('api') PathPart('scmdiff') Args(0) {
    my ($self, $c) = @_;
    my $uri = $c->request->params->{uri} ;
    my $type = $c->request->params->{type} ;
    my $branch = $c->request->params->{branch} ;
    my $rev1 = $c->request->params->{rev1} ;
    my $rev2 = $c->request->params->{rev2} ;
    my $diff = "";
    if($type eq "hg") {
    my $clonePath = scmPath . "/" . sha256_hex($uri);
    die if ! -d $clonePath;
    $diff .= `(cd $clonePath ; hg log -r $rev1:$rev2)`;
    $diff .= `(cd $clonePath ; hg diff -r $rev1:$rev2)`;
    } elsif ($type eq "git") {
    my $clonePath = scmPath . "/" . sha256_hex($uri.$branch);
    die if ! -d $clonePath;
    $diff .= `(cd $clonePath ; git log $rev1..$rev2)`;
    $diff .= `(cd $clonePath ; git diff $rev1..$rev2)`;
    }
    $c->stash->{'plain'} = { data => (scalar $diff) || " " };
  • edit in src/lib/Hydra/Controller/Root.pm at line 153
    [3.37]
    [3.37]
    , uri_for('API', 'scmdiff', [])
  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 15
    [5.2785][4.167:307]()
    our @EXPORT = qw(fetchInput evalJobs checkBuild inputsToArgs captureStdoutStderr getReleaseName getBuildLog addBuildProducts restartBuild);
    [5.2785]
    [5.2815]
    our @EXPORT = qw(fetchInput evalJobs checkBuild inputsToArgs captureStdoutStderr getReleaseName getBuildLog addBuildProducts restartBuild scmPath);
  • replacement in src/root/common.tt at line 311
    [5.524][5.524:545]()
    [% contents %]
    [5.524]
    [5.545]
    [% res = bi1.uri.split(' ') %]
    [% url = res.0 %]
    [% branch = res.1 %]
    [% IF bi1.type == "hg" || bi1.type == "git" %]
    <a target="_new" href="/api/scmdiff?uri=[% url %]&rev1=[% bi1.revision %]&rev2=[% bi2.revision %]&type=[% bi1.type %]&branch=[% branch %]">[% contents %]</a>
    [% ELSE %]
    [% contents %]
    [% END %]