From 4a6f798ef4c3db1f59946b99a75813b5fc59e68d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Apr 2012 16:21:28 +0200 Subject: [PATCH] Fix Mercurial input fetching if a cached input has been GC'ed Fixes Hydra/76. --- src/lib/Hydra/Helper/AddBuilds.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index ce5f00a1..feec1c98 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -138,7 +138,7 @@ sub fetchInputPath { # (or changes back), we don't get a new "revision". if (!defined $cachedInput) { txn_do($db, sub { - $db->resultset('CachedPathInputs')->create( + $db->resultset('CachedPathInputs')->update_or_create( { srcpath => $uri , timestamp => $timestamp , lastseen => $timestamp @@ -567,7 +567,7 @@ sub fetchInputHg { ($sha256, $storePath) = split ' ', $stdout; txn_do($db, sub { - $db->resultset('CachedHgInputs')->create( + $db->resultset('CachedHgInputs')->update_or_create( { uri => $uri , branch => $branch , revision => $revision