Author: eelco
Date: Tue May  3 09:21:27 2011
New Revision: 27114
URL: https://svn.nixos.org/websvn/nix/?rev=27114&sc=1

Log:
* Use default values of job function arguments if they're not
  specified in Hydra.

Modified:
   hydra/trunk/src/c/hydra_eval_jobs.cc

Modified: hydra/trunk/src/c/hydra_eval_jobs.cc
==============================================================================
--- hydra/trunk/src/c/hydra_eval_jobs.cc        Tue May  3 09:04:18 2011        
(r27113)
+++ hydra/trunk/src/c/hydra_eval_jobs.cc        Tue May  3 09:21:27 2011        
(r27114)
@@ -49,13 +49,17 @@
         return;
     }
 
-    AutoArgs::const_iterator a = argsLeft.find(cur->name);
+    Formals::Formals_::iterator next = cur; ++next;
 
-    if (a == argsLeft.end())
-        throw TypeError(format("job `%1%' requires an argument named `%2%'")
-            % attrPath % cur->name);
+    AutoArgs::const_iterator a = argsLeft.find(cur->name);
 
-    Formals::Formals_::iterator next = cur; ++next;
+    if (a == argsLeft.end()) {
+        if (!cur->def)
+            throw TypeError(format("job `%1%' requires an argument named 
`%2%'")
+                % attrPath % cur->name);
+        tryJobAlts(state, doc, argsUsed, argsLeft, attrPath, fun, next, last, 
actualArgs);
+        return;
+    }
 
     int n = 0;
     foreach (ValueList::const_iterator, i, a->second) {
_______________________________________________
nix-commits mailing list
nix-comm...@cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to