Do incremental SVN checkouts
[?]
Dec 4, 2011, 9:01 PM
ARD6Z67TDHK2XMW47CSVOXXF327YGOMYK3EAXTSVVXNDAFQYNO5ACDependencies
- [2]
KX5L74EYadd nix-prefetch- scripts for now, were externals in svn - [3]
JZE7DC2FWhitespace - [4]
TM6XBAG2git branches can share local clones - [5]
L4AI5YL6Rename hydra_*.pl to hydra-* - [6]
BMSQD2ZHIndentation - [7]
6MGFQDR2deleted some old scripts - [8]
FV2M6MOThydra: use autoconf/-make - [9]
O25D52TAinitial support for mercurial - [10]
FKTXLQVZhydra: nix-prefetch-bzr missing in tarball - [11]
KQS7DSKJ* Clean up indentation. - [12]
V2MLUZRPRandom indentation fix - [13]
ENYUXIFPsupport git branches as input in stead of only master branch - [14]
CHQEG6WYHydra/29: Added timeout to svn/git checkouts, job evaluation - [15]
3XTHEUMP* Implemented the clone feature. - [16]
FGI75W53move nix-prefetch-* into tarball - [17]
FXW2UR7Finitial bzr support - [18]
2WUNXJGWHydra/26: Go back to using "svn export" as default for svn, added svn-checkout type for jobset which need .svn dirs. export is much more efficient - [19]
BK24VA6Q* for git inputs, check latest revision of branch (defaults to master for now), if there is change, only use input if last checkout was > hour ago. - [20]
HQ4QHAOFmake default branch default, remove quotes - [21]
C7CXMZ66hydra: do not perform git clone every time. in stead work on local clone and pull - [22]
M73H45NEadd support for mercurial tags/revs - [23]
UO67NQMRChange `fetchInputGit' to do `git clone -b BRANCH' instead of `git clone'. - [24]
Q6SOGMDQHydra/28: Rename "scheduler" to "evaluator" - [25]
OOQ2D3KC* Refactoring: move fetchInput out of hydra_scheduler into a separate - [26]
D5QIOJGP* Move everything up one directory. - [27]
JTRG7RDQadd support for git as jobinput - [28]
DBPIYHMAhydra: add nix-prefetch-* to tarball
Change contents
- edit in src/lib/Hydra/Helper/AddBuilds.pm at line 14
use File::Temp; - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 186
# Do we already have this revision in the store?# !!! This needs to take $checkout into account! Otherwise "svn"# and "svn-checkout" inputs can get mixed up. - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 196[6.2818]→[6.7673:7686](∅→∅),[6.7673]→[6.7673:7686](∅→∅),[6.7686]→[6.2819:3046](∅→∅),[6.3046]→[6.186:257](∅→∅)
# Then download this revision into the store.print STDERR "checking out Subversion input ", $name, " from $uri revision $revision\n";$ENV{"NIX_HASH_ALGO"} = "sha256";$ENV{"PRINT_PATH"} = "1";$ENV{"NIX_PREFETCH_SVN_LEAVE_DOT_SVN"} = "$checkout";# No, do a checkout. The working copy is reused between# invocations to speed things up.mkpath(scmPath . "/svn");my $wcPath = scmPath . "/svn" . sha256_hex($uri) . "/svn-checkout";print STDERR "checking out Subversion input ", $name, " from $uri revision $revision into $wcPath\n"; - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 205
("nix-prefetch-svn", $uri, $revision));die "Cannot check out Subversion repository `$uri':\n$stderr" unless $res;("svn", "checkout", $uri, "-r", $revision, $wcPath));if ($checkout) {$storePath = addToStore($wcPath, 1, "sha256");} else {# Hm, if the Nix Perl bindings supported filters in# addToStore(), then we wouldn't need to make a copy here.my $tmpDir = File::Temp->newdir("hydra-svn-export.XXXXXX", CLEANUP => 1, TMPDIR => 1) or die;(system "svn", "export", $wcPath, "$tmpDir/svn-export", "--quiet") == 0 or die "svn export failed";$storePath = addToStore("$tmpDir/svn-export", 1, "sha256");} - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 217
($sha256, $storePath) = split ' ', $stdout;$sha256 = queryPathHash($storePath); $sha256 =~ s/sha256://; - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 220
$db->resultset('CachedSubversionInputs')->create($db->resultset('CachedSubversionInputs')->update_or_create( - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 328
my $clonePath; - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 329
$clonePath = scmPath . "/" . sha256_hex($uri);my $clonePath = scmPath . "/" . sha256_hex($uri); - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 427
my $clonePath; - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 429
$clonePath = scmPath . "/" . sha256_hex($uri);my $clonePath = scmPath . "/" . sha256_hex($uri); - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 500
my $clonePath; - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 502
$clonePath = scmPath . "/" . sha256_hex($uri);my $clonePath = scmPath . "/" . sha256_hex($uri); - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 643
(my $timeout, my @cmd) = @_;my ($timeout, @cmd) = @_; - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 665
- file deletion: nix-prefetch-svn
#! /bin/sh -eurl=$1rev=$2expHash=$3hashType=$NIX_HASH_ALGOif test -z "$hashType"; thenhashType=sha256fiif test -z "$hashFormat"; thenhashFormat=--base32fiif test -z "$url"; thenecho "syntax: nix-prefetch-svn URL [REVISION [EXPECTED-HASH]]" >&2exit 1fitest -n "$rev" || rev="HEAD"repoName=$(echo $url | sed 's,.*/\([^/]\+\)/trunk/*$,\1,;ts,.*/\([^/]\+\)/branches/\([^/]\+\)/*$,\1-\2,;ts,.*/\([^/]\+\)/tags/\([^/]\+\)/*$,\1-\2,;ts,.*/\([^/]\+\)/*$,\1,;t')dstFile=$repoName-r$rev# If the hash was given, a file with that hash may already be in the# store.if test -n "$expHash"; thenfinalPath=$(nix-store --print-fixed-path --recursive "$hashType" "$expHash" $dstFile)if ! nix-store --check-validity "$finalPath" 2> /dev/null; thenfinalPath=fihash=$expHashfi# If we don't know the hash or a path with that hash doesn't exist,# download the file and add it to the store.if test -z "$finalPath"; thentmpPath=/tmp/svn-checkout-tmp-$$tmpFile=$tmpPath/$dstFilemkdir $tmpPathtrap "rm -rf $tmpPath" EXIT# Perform the checkout.if test "$NIX_PREFETCH_SVN_LEAVE_DOT_SVN" != 1thencommand="export"elsecommand="checkout"fiecho p | svn "$command" --quiet -r "$rev" "$url" "$tmpFile" >&2# Compute the hash.hash=$(nix-hash --type $hashType $hashFormat $tmpFile)if ! test -n "$QUIET"; then echo "hash is $hash" >&2; fi# Add the downloaded file to the Nix store.finalPath=$(nix-store --add-fixed --recursive "$hashType" $tmpFile)if test -n "$expHash" -a "$expHash" != "$hash"; thenecho "hash mismatch for URL \`$url'"exit 1fifiif ! test -n "$QUIET"; then echo "path is $finalPath" >&2; fiecho $hashif test -n "$PRINT_PATH"; thenecho $finalPathfi - edit in src/script/Makefile.am at line 3
nix-prefetch-svn \nix-prefetch-git \nix-prefetch-bzr \nix-prefetch-hg \ - edit in src/script/Makefile.am at line 12
nix-prefetch-svn \