From 1122f3f693584b737d64d053d956c83159712102 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Tue, 8 Jul 2008 01:11:52 +0000 Subject: [PATCH] Mantis#1685. Thank you kindly, Mjm for a patch that: The attached patch tries to read the SVN revision from local file "svn_revision" before checking "../.svn/entries". This allows simulators not running from the source tree to properly display the SVN revision, if the installer generates the "svn_revision" file. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 62177a6642..dac784e5fe 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -230,13 +230,24 @@ namespace OpenSim.Framework.Servers string buildVersion = string.Empty; // Add subversion revision information if available + // Try file "svn_revision" in the current directory first, then the .svn info. + // This allows to make the revision available in simulators not running from the source tree. // FIXME: Making an assumption about the directory we're currently in - we do this all over the place // elsewhere as well + string svnRevisionFileName = "svn_revision"; string svnFileName = "../.svn/entries"; string inputLine; int strcmp; - if (File.Exists(svnFileName)) + if (File.Exists(svnRevisionFileName)) + { + StreamReader RevisionFile = File.OpenText(svnRevisionFileName); + buildVersion = RevisionFile.ReadLine(); + buildVersion.Trim(); + RevisionFile.Close(); + } + + if (string.IsNullOrEmpty(buildVersion) && File.Exists(svnFileName)) { StreamReader EntriesFile = File.OpenText(svnFileName); inputLine = EntriesFile.ReadLine();