Fix Mercurial diff

[?]
Apr 11, 2017, 11:39 AM
7FRO5BGHR4KFOL4WAQOEJLFBIEGORWCDQ2R3M6M2XSWSJHYGGMUQC

Dependencies

  • [2] JAH3UPWA Support revision control systems via plugins
  • [3] ODWGRX32 check for revisions
  • [4] HPEG2RHV Merge the BuildResultInfo table into the Builds table
  • [5] SHYRGAWZ hydra: when no external url is given for diff's of git/hg input, revert to a diff done on a local available clone
  • [6] BAOVFU73 fix mercurial diffs, should change to cloned repo first
  • [7] HZ2U4QEV no branch info available yet in scmdiff, so disable for now
  • [8] CQTN62OH Die tabs die
  • [9] TH674WKJ add log diff to compare logs to previous builds
  • [*] BKOIYITR added some json responses

Change contents

  • edit in src/lib/Hydra/Controller/API.pm at line 16
    [3.83]
    [3.653]
    use IPC::Run qw(run);
  • edit in src/lib/Hydra/Controller/API.pm at line 179
    [3.2264][3.0:16](),[3.418][3.0:16]()
    my $branch;
  • replacement in src/lib/Hydra/Controller/API.pm at line 187
    [2.101][3.520:552](),[3.520][3.520:552](),[3.552][3.2403:2479](),[3.2479][3.288:421]()
    die if ! -d $clonePath;
    $branch = `(cd $clonePath; hg log --template '{branch}' -r $rev2)`;
    $diff .= `(cd $clonePath; hg log -r $rev1 -r $rev2 -b $branch)`;
    $diff .= `(cd $clonePath; hg diff -r $rev1:$rev2)`;
    [2.101]
    [3.659]
    die "repository '$uri' is not in the SCM cache\n" if ! -d $clonePath;
    my $out;
    run(["hg", "log", "-R", $clonePath, "-r", "reverse($rev1::$rev2) and not($rev1)"], \undef, \$out)
    or die "hg log failed";
    $diff .= $out;
    run(["hg", "diff", "-R", $clonePath, "-r", "$rev1::$rev2"], \undef, \$out)
    or die "hg diff failed";
    $diff .= $out;