Author: ludo
Date: Tue Oct 4 16:15:22 2011
New Revision: 29641
URL: https://ssl.nixos.org/websvn/nix/?rev=29641&sc=1
Log:
Allow Subversion inputs to specify a revision number.
Modified:
hydra/trunk/src/lib/Hydra/Helper/AddBuilds.pm
Modified: hydra/trunk/src/lib/Hydra/Helper/AddBuilds.pm
==============================================================================
--- hydra/trunk/src/lib/Hydra/Helper/AddBuilds.pm Tue Oct 4 16:15:19
2011 (r29640)
+++ hydra/trunk/src/lib/Hydra/Helper/AddBuilds.pm Tue Oct 4 16:15:22
2011 (r29641)
@@ -157,18 +157,22 @@
sub fetchInputSVN {
my ($db, $project, $jobset, $name, $type, $value, $checkout) = @_;
- my $uri = $value;
+ # Allow users to specify a revision number next to the URI.
+ my ($uri, $revision) = split ' ', $value;
my $sha256;
my $storePath;
-
- # First figure out the last-modified revision of the URI.
- my @cmd = (["svn", "ls", "-v", "--depth", "empty", $uri],
- "|", ["sed", 's/^ *\([0-9]*\).*/\1/']);
my $stdout; my $stderr;
- die "Cannot get head revision of Subversion repository at `$uri':\n$stderr"
- unless IPC::Run::run(@cmd, \$stdout, \$stderr);
- my $revision = $stdout; chomp $revision;
+
+ unless (defined $revision) {
+ # First figure out the last-modified revision of the URI.
+ my @cmd = (["svn", "ls", "-v", "--depth", "empty", $uri],
+ "|", ["sed", 's/^ *\([0-9]*\).*/\1/']);
+ die "Cannot get head revision of Subversion repository at
`$uri':\n$stderr"
+ unless IPC::Run::run(@cmd, \$stdout, \$stderr);
+ $revision = $stdout; chomp $revision;
+ }
+
die unless $revision =~ /^\d+$/;
(my $cachedInput) = $db->resultset('CachedSubversionInputs')->search(
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits