cmStateDirectory: Rename ConvertToRelPathIf{Not => }Contained

The "Not" in the method name is backward from its logic.
This commit is contained in:
Brad King 2021-05-12 15:26:12 -04:00
parent 09bee3bee1
commit ba7b939831
7 changed files with 8 additions and 8 deletions

View File

@ -3029,7 +3029,7 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
// Shorten the output name (in expected use case).
cmStateDirectory cmDir =
this->GetMakefiles()[0]->GetStateSnapshot().GetDirectory();
std::string fname = cmDir.ConvertToRelPathIfNotContained(
std::string fname = cmDir.ConvertToRelPathIfContained(
this->GetMakefiles()[0]->GetState()->GetBinaryDirectory(), outputs[0]);
// Associate the hash with this output.

View File

@ -610,7 +610,7 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
tname += "/fast";
}
tname =
mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfNotContained(
mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfContained(
mf->GetState()->GetBinaryDirectory(), tname);
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.Add(std::move(tname));

View File

@ -550,7 +550,7 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out) const
cmListFileContext lfc = this->TopEntry->Context;
cmStateSnapshot bottom = this->GetBottom();
if (!bottom.GetState()->GetIsInTryCompile()) {
lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfNotContained(
lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfContained(
bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
}
out << (lfc.Line ? " at " : " in ") << lfc;
@ -581,7 +581,7 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
}
cmListFileContext lfc = cur->Context;
if (!bottom.GetState()->GetIsInTryCompile()) {
lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfNotContained(
lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfContained(
bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
}
out << " " << lfc << "\n";

View File

@ -3676,7 +3676,7 @@ std::string const& cmLocalGenerator::GetCurrentSourceDirectory() const
std::string cmLocalGenerator::MaybeConvertToRelativePath(
std::string const& local_path, std::string const& remote_path) const
{
return this->StateSnapshot.GetDirectory().ConvertToRelPathIfNotContained(
return this->StateSnapshot.GetDirectory().ConvertToRelPathIfContained(
local_path, remote_path);
}

View File

@ -159,7 +159,7 @@ bool cmStateDirectory::ContainsBoth(std::string const& local_path,
return bothInBinary || bothInSource;
}
std::string cmStateDirectory::ConvertToRelPathIfNotContained(
std::string cmStateDirectory::ConvertToRelPathIfContained(
std::string const& local_path, std::string const& remote_path) const
{
if (!this->ContainsBoth(local_path, remote_path)) {

View File

@ -36,7 +36,7 @@ public:
bool ContainsBoth(std::string const& local_path,
std::string const& remote_path) const;
std::string ConvertToRelPathIfNotContained(
std::string ConvertToRelPathIfContained(
std::string const& local_path, std::string const& remote_path) const;
cmStringRange GetIncludeDirectoriesEntries() const;

View File

@ -934,7 +934,7 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
for (auto const& cmd : this->impl->TLLCommands) {
if (cmd.first == sig) {
cmListFileContext lfc = cmd.second;
lfc.FilePath = cmDir.ConvertToRelPathIfNotContained(
lfc.FilePath = cmDir.ConvertToRelPathIfContained(
this->impl->Makefile->GetState()->GetSourceDirectory(), lfc.FilePath);
s << " * " << lfc << '\n';
}