Mark content-addressable paths with references as experimental

This commit is contained in:
Eelco Dolstra 2019-10-21 18:05:31 +02:00
parent e68736936a
commit 629b9b0049
2 changed files with 6 additions and 1 deletions

View file

@ -1013,8 +1013,11 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
std::unique_ptr<AbstractHashSink> hashSink; std::unique_ptr<AbstractHashSink> hashSink;
if (info.ca == "") if (info.ca == "")
hashSink = std::make_unique<HashSink>(htSHA256); hashSink = std::make_unique<HashSink>(htSHA256);
else else {
if (!info.references.empty())
settings.requireExperimentalFeature("ca-references");
hashSink = std::make_unique<HashModuloSink>(htSHA256, storePathToHash(info.path)); hashSink = std::make_unique<HashModuloSink>(htSHA256, storePathToHash(info.path));
}
LambdaSource wrapperSource([&](unsigned char * data, size_t len) -> size_t { LambdaSource wrapperSource([&](unsigned char * data, size_t len) -> size_t {
size_t n = source.read(data, len); size_t n = source.read(data, len);

View file

@ -26,11 +26,13 @@ struct CmdHash : Command
mkFlag() mkFlag()
.longName("type") .longName("type")
.mkHashTypeFlag(&ht); .mkHashTypeFlag(&ht);
#if 0
mkFlag() mkFlag()
.longName("modulo") .longName("modulo")
.description("compute hash modulo specified string") .description("compute hash modulo specified string")
.labels({"modulus"}) .labels({"modulus"})
.dest(&modulus); .dest(&modulus);
#endif
expectArgs("paths", &paths); expectArgs("paths", &paths);
} }