Login
repoOrCheckout.s2 at [428464d569]
Login

File s2/require.d/fsl/db/repoOrCheckout.s2 artifact e98a662a0f part of check-in 428464d569


/**
   require.s2 module which returns either the repo db
   (specified by the -R|--repo-db=DBFILE script flags)
   or (if that fails)
*/
affirm Fossil;
if(Fossil.db){
    Fossil.db.repo && return Fossil.db.repo;
    Fossil.db.checkout && return Fossil.db.checkout;
    affirm Fossil.db.config /* that's the only other possibility */;
}
return requireS2(
['fsl/context'],
proc(fsl){
    var db;
    catch{
        return requireS2(['fsl/db/repo']).0 // fails if no -R|--repo-db=DBFILE flag specified
    };
    return requireS2(['fsl/db/checkout']).0;
});