diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-04-20 22:58:16 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-04-22 20:54:25 +0200 |
commit | 2ee87680556ccf26ef8d415950e7f31034d647c4 (patch) | |
tree | 376adaa01623892213463507c25d17e042055c2b /src/Eval.hs | |
parent | ce477ae0b39b97a82a86776e076492120e3180eb (diff) |
Verbose option for ‘jobid’ command
Diffstat (limited to 'src/Eval.hs')
-rw-r--r-- | src/Eval.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Eval.hs b/src/Eval.hs index 4e9f528..013c074 100644 --- a/src/Eval.hs +++ b/src/Eval.hs @@ -56,7 +56,7 @@ isDefaultRepoMissingInId djob where matches (JobIdName _) = False matches (JobIdCommit rname _) = isNothing rname - matches (JobIdTree rname _) = isNothing rname + matches (JobIdTree rname _ _) = isNothing rname collectOtherRepos :: DeclaredJob -> Eval [ (( Maybe RepoName, Maybe Text ), FilePath ) ] collectOtherRepos decl = do @@ -75,7 +75,7 @@ evalJob revisionOverrides decl = do EvalInput {..} <- ask otherRepos <- collectOtherRepos decl otherRepoTrees <- forM otherRepos $ \(( mbname, mbrev ), commonPath ) -> do - ( mbname, ) <$> case lookup mbname revisionOverrides of + ( mbname, ) . ( commonPath, ) <$> case lookup mbname revisionOverrides of Just tree -> return tree Nothing -> case maybe eiContainingRepo (flip lookup eiOtherRepos) mbname of Just repo -> do @@ -84,11 +84,11 @@ evalJob revisionOverrides decl = do Nothing -> throwError $ OtherEvalError $ "repo ‘" <> maybe "" textRepoName mbname <> "’ not defined" otherCheckout <- forM (jobOtherCheckout decl) $ \(( name, _ ), checkout ) -> do - (, checkout ) <$> case lookup (Just name) otherRepoTrees of + (, checkout ) <$> case snd <$> lookup (Just name) otherRepoTrees of Just tree -> return tree Nothing -> throwError $ OtherEvalError $ "repo ‘" <> textRepoName name <> "’ not defined" - let otherRepoIds = map (uncurry JobIdTree . fmap treeId) otherRepoTrees + let otherRepoIds = map (\( name, ( subtree, tree )) -> JobIdTree name subtree (treeId tree)) otherRepoTrees return Job { jobId = JobId $ reverse $ reverse otherRepoIds ++ JobIdName (jobId decl) : eiCurrentIdRev , jobName = jobName decl @@ -148,7 +148,7 @@ canonicalCommitConfig :: [ Text ] -> Repo -> Eval JobId canonicalCommitConfig rs repo = do ( tree, rs' ) <- readTreeFromIdRef rs "" repo config <- either fail return =<< loadConfigForCommit tree - local (\ei -> ei { eiCurrentIdRev = JobIdTree Nothing (treeId tree) : eiCurrentIdRev ei }) $ + local (\ei -> ei { eiCurrentIdRev = JobIdTree Nothing "" (treeId tree) : eiCurrentIdRev ei }) $ canonicalJobName rs' config evalJobReference :: JobRef -> Eval JobId |