From 7b1d87fde9e73c1f89e978a79afa2a2e1ff47a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 22 Mar 2011 22:21:19 +0000 Subject: [PATCH] fetchInputGit: Populate TopGit branches when on a topic branch. --- src/lib/Hydra/Helper/AddBuilds.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 3d3c91b7..2a497ab6 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -326,6 +326,15 @@ sub fetchInputGit { (my $revision, my $ref) = split ' ', $first; die unless $revision =~ /^[0-9a-fA-F]+$/; + if (-f ".topdeps") { + # This is a TopGit branch. Fetch all the topic branches so + # that builders can run "tg patch" and similar. + (my $res, $stdout, $stderr) = captureStdoutStderr(600, + ("tg", "remote", "--populate", "origin")); + + print STDERR "Warning: `tg remote --populate origin' failed:\n$stderr" unless $res; + } + # Some simple caching: don't check a uri/branch more than once every hour, but prefer exact match on uri/branch/revision. my $cachedInput ; ($cachedInput) = $db->resultset('CachedGitInputs')->search(