Fixed issue 10201: The core revision Id of about page is shown correctly
authorGuillermo Álvarez de Eulate <guillermo.alvarez@openbravo.com>
Wed, 07 Mar 2012 15:09:50 +0100
changeset 15752 b82a1d5eabd1
parent 15751 0855f56267d9
child 15753 e608357087bc
Fixed issue 10201: The core revision Id of about page is shown correctly

ant install.source tries to get the current revision from merurial. If mercurial isn't present it try to get from file (config/instance.version). In case of both aren't present a '-' will be write. It is better than show an ant variable instance.version
src/build.xml
--- a/src/build.xml	Wed Mar 07 10:39:18 2012 +0100
+++ b/src/build.xml	Wed Mar 07 15:09:50 2012 +0100
@@ -347,9 +347,19 @@
 		  <available file="${basedir}/config/instance.revision"/>
 	    </and>
 	  </condition>
+	  <condition property="revision.not.found">
+		<and>
+		  <not>
+		 	<isset property="hg.id"/>
+		  </not>
+		  <not>
+		  	<available file="${basedir}/config/instance.revision"/>
+		  </not>
+	    </and>
+	  </condition>
 	  <antcall inheritall="true" target="calculate.instance.version"/>
 	</target>
-	<target name="calculate.instance.version" depends="calculate.version.from.hg, calculate.version.from.file">
+	<target name="calculate.instance.version" depends="calculate.version.from.hg, calculate.version.from.file, cannot.find.version">
 	    <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" delimiter="/">
 	      <classpath>
 	        <fileset dir="${base.lib}">
@@ -368,7 +378,10 @@
 	  <property name="instance.version" value="${hg.id}"/>
 	</target>
 	<target name="calculate.version.from.file" if="revision.from.file">
-		<loadfile property="instance.version" srcfile="${basedir}/config/instance.revision"/>
+	  <loadfile property="instance.version" srcfile="${basedir}/config/instance.revision"/>
+	</target>
+	<target name="cannot.find.version" if="revision.not.found">
+	  <property name="instance.version" value=" - "/>
 	</target>
 
   <target name="compile.src.gen" depends="init">