Browse Source

cmStateDirectory: Rename ConvertToRelPathIf{Not => }Contained

The "Not" in the method name is backward from its logic.
Brad King 4 years ago
parent
commit
ba7b939831

+ 1 - 1
Source/cmGlobalGenerator.cxx

@@ -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.

+ 1 - 1
Source/cmGlobalUnixMakefileGenerator3.cxx

@@ -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));

+ 2 - 2
Source/cmListFileCache.cxx

@@ -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";

+ 1 - 1
Source/cmLocalGenerator.cxx

@@ -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);
 }
 

+ 1 - 1
Source/cmStateDirectory.cxx

@@ -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)) {

+ 1 - 1
Source/cmStateDirectory.h

@@ -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;

+ 1 - 1
Source/cmTarget.cxx

@@ -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';
     }