Remove Input::hasAllInfo()

This commit is contained in:
Eelco Dolstra 2022-08-10 16:51:45 +02:00
parent 90e9f50a66
commit 3b45475f75
8 changed files with 0 additions and 52 deletions

View file

@ -101,11 +101,6 @@ std::optional<CanonPath> Input::isRelative() const
return scheme->isRelative(*this);
}
bool Input::hasAllInfo() const
{
return getNarHash() && scheme && scheme->hasAllInfo(*this);
}
bool Input::operator ==(const Input & other) const
{
return attrs == other.attrs;
@ -170,11 +165,6 @@ void Input::checkLocks(Input & input) const
throw Error("'revCount' attribute mismatch in input '%s', expected %d",
input.to_string(), *prevRevCount);
}
// FIXME
#if 0
assert(input.hasAllInfo());
#endif
}
std::pair<ref<InputAccessor>, Input> Input::getAccessor(ref<Store> store) const

View file

@ -55,8 +55,6 @@ public:
relative path, i.e. './foo'. */
std::optional<CanonPath> isRelative() const;
bool hasAllInfo() const;
bool operator ==(const Input & other) const;
bool contains(const Input & other) const;
@ -119,8 +117,6 @@ struct InputScheme
virtual ParsedURL toURL(const Input & input) const;
virtual bool hasAllInfo(const Input & input) const = 0;
virtual Input applyOverrides(
const Input & input,
std::optional<std::string> ref,

View file

@ -204,15 +204,6 @@ struct GitInputScheme : InputScheme
return url;
}
bool hasAllInfo(const Input & input) const override
{
bool maybeDirty = !input.getRef();
bool shallow = maybeGetBoolAttr(input.attrs, "shallow").value_or(false);
return
maybeGetIntAttr(input.attrs, "lastModified")
&& (shallow || maybeDirty || maybeGetIntAttr(input.attrs, "revCount"));
}
Input applyOverrides(
const Input & input,
std::optional<std::string> ref,

View file

@ -134,13 +134,6 @@ struct GitArchiveInputScheme : InputScheme
};
}
bool hasAllInfo(const Input & input) const override
{
return input.getRev() &&
true; // FIXME
//maybeGetIntAttr(input.attrs, "lastModified");
}
Input applyOverrides(
const Input & _input,
std::optional<std::string> ref,

View file

@ -76,11 +76,6 @@ struct IndirectInputScheme : InputScheme
return url;
}
bool hasAllInfo(const Input & input) const override
{
return false;
}
Input applyOverrides(
const Input & _input,
std::optional<std::string> ref,

View file

@ -98,13 +98,6 @@ struct MercurialInputScheme : InputScheme
return url;
}
bool hasAllInfo(const Input & input) const override
{
// FIXME: ugly, need to distinguish between dirty and clean
// default trees.
return input.getRef() == "default" || maybeGetIntAttr(input.attrs, "revCount");
}
Input applyOverrides(
const Input & input,
std::optional<std::string> ref,

View file

@ -84,11 +84,6 @@ struct PathInputScheme : InputScheme
return (bool) input.getNarHash();
}
bool hasAllInfo(const Input & input) const override
{
return true;
}
void putFile(
const Input & input,
const CanonPath & path,

View file

@ -232,11 +232,6 @@ struct CurlInputScheme : InputScheme
return url;
}
bool hasAllInfo(const Input & input) const override
{
return true;
}
bool isLocked(const Input & input) const override
{
return (bool) input.getNarHash();