]> granicus.if.org Git - clang/commitdiff
Basic: Attempt to make version tags work from 'svn export's again.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 11 Oct 2010 23:44:19 +0000 (23:44 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 11 Oct 2010 23:44:19 +0000 (23:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116268 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Version.cpp

index 67c6c36c92146c5b8304897dc079d896f56c4324..545ef53e6d858aebf7fa5e70f97311b635c4b21c 100644 (file)
@@ -28,6 +28,12 @@ std::string getClangRepositoryPath() {
   llvm::StringRef URL("");
 #endif
 
+  // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
+  // pick up a tag in an SVN export, for example.
+  static llvm::StringRef SVNRepository("$URL$");
+  if (URL.empty())
+    URL = SVNRepository.split(':').second;
+
   // Strip off version from a build from an integration branch.
   URL = URL.slice(0, URL.find("/src/tools/clang"));