Fixes issue 8086: take the revision id from Hg, not SVN
authorJuan Pablo Aroztegi <juanpablo.aroztegi@openbravo.com>
Fri, 08 May 2009 13:50:12 +0200
changeset 3841 0958b4ae7fe5
parent 3840 80bcdfbac81a
child 3842 3213ce4af37b
Fixes issue 8086: take the revision id from Hg, not SVN
build.xml
src-db/database/build-create.xml
src-db/database/build.xml
src-db/database/lib/dbsourcemanager.jar
src/org/openbravo/erpCommon/ad_forms/About.html
src/org/openbravo/erpCommon/ad_forms/About_data.xsql
--- a/build.xml	Fri May 08 13:36:52 2009 +0200
+++ b/build.xml	Fri May 08 13:50:12 2009 +0200
@@ -103,10 +103,7 @@
   <property name="force" value="false" />
   <property name="local" value="true" />
 
-  <available file=".svn/entries" property="is.svn" />
-
-
-
+  <available file=".hg" property="is.hg" />
 
 
   <condition property="deploy.mode" value="class">
@@ -206,23 +203,16 @@
   </target>
 
   <target name="code.rev" depends="set.code.rev">
-    <condition property="code.revision" value="${svn.entries}" else="0">
-      <isset property="svn.entries" />
+    <condition property="code.revision" value="${hg.id}" else="0">
+      <isset property="hg.id" />
     </condition>
   </target>
 
-  <target name="set.code.rev" if="is.svn">
-    <loadfile property="svn.entries" srcFile=".svn/entries" failonerror="false">
-      <filterchain>
-        <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
-          <param name="skip" value="3" />
-          <param name="lines" value="1" />
-        </filterreader>
-      </filterchain>
-      <filterchain>
-        <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" />
-      </filterchain>
-    </loadfile>
+  <target name="set.code.rev" if="is.hg">
+    <exec executable="hg" outputproperty="hg.id" failifexecutionfails="false">
+      <arg value="id"/>
+      <arg value="-i"/>
+    </exec>
   </target>
 
   <target name="compile.complete" depends="init">
--- a/src-db/database/build-create.xml	Fri May 08 13:36:52 2009 +0200
+++ b/src-db/database/build-create.xml	Fri May 08 13:50:12 2009 +0200
@@ -249,7 +249,7 @@
           VALUES ('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '?', 20, 100,  1, 'Default');
           DELETE FROM AD_SYSTEM_INFO;
           INSERT INTO AD_SYSTEM_INFO(AD_SYSTEM_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ANT_VERSION, OB_VERSION, OB_INSTALLMODE, CODE_REVISION)
-          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', ${code.revision});
+          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', '${code.revision}');
           DELETE FROM AD_REGISTRATION_INFO;
           INSERT INTO AD_REGISTRATION_INFO(AD_REGISTRATION_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY)
           VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0');
@@ -287,7 +287,7 @@
           VALUES ('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '?', 20, 100, 1, 'Default');
           DELETE FROM AD_SYSTEM_INFO;
           INSERT INTO AD_SYSTEM_INFO(AD_SYSTEM_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ANT_VERSION, OB_VERSION, OB_INSTALLMODE, CODE_REVISION)
-          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', ${code.revision});
+          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', '${code.revision}');
           DELETE FROM AD_REGISTRATION_INFO;
           INSERT INTO AD_REGISTRATION_INFO(AD_REGISTRATION_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY)
           VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0');
--- a/src-db/database/build.xml	Fri May 08 13:36:52 2009 +0200
+++ b/src-db/database/build.xml	Fri May 08 13:50:12 2009 +0200
@@ -322,7 +322,7 @@
           VALUES ('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '?', 20, 100, 1, 'Default');
           DELETE FROM AD_SYSTEM_INFO;
           INSERT INTO AD_SYSTEM_INFO(AD_SYSTEM_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ANT_VERSION, OB_VERSION, OB_INSTALLMODE, CODE_REVISION)
-          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', ${code.revision});
+          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', '${code.revision}');
           DELETE FROM AD_REGISTRATION_INFO;
           INSERT INTO AD_REGISTRATION_INFO(AD_REGISTRATION_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY)
           VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0');
@@ -347,7 +347,7 @@
           VALUES ('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '?', 20, 100, 1, 'Default');
           DELETE FROM AD_SYSTEM_INFO;
           INSERT INTO AD_SYSTEM_INFO(AD_SYSTEM_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ANT_VERSION, OB_VERSION, OB_INSTALLMODE, CODE_REVISION)
-          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', ${code.revision});
+          VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '${ant.version}', '${application.version}', 'From Sources', '${code.revision}');
           DELETE FROM AD_REGISTRATION_INFO;
           INSERT INTO AD_REGISTRATION_INFO(AD_REGISTRATION_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY)
           VALUES('0', '0', '0', 'Y', NOW(), '0', NOW(), '0');
@@ -371,7 +371,7 @@
           DELETE FROM AD_SYSTEM;
           INSERT INTO AD_SYSTEM (AD_SYSTEM_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, TAD_RECORDRANGE, TAD_RECORDRANGE_INFO, TAD_TRANSACTIONALRANGE, TAD_THEME)
           VALUES ('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '?', 20, 100, 1, 'Default');
-        	UPDATE AD_SYSTEM_INFO SET CODE_REVISION=${code.revision};
+        	UPDATE AD_SYSTEM_INFO SET CODE_REVISION='${code.revision}';
         	CALL AD_UPDATE_SEQUENCE();
           CALL AD_UPDATE_ACCESS();
           UPDATE AD_MODULE SET ISINDEVELOPMENT='N', ISDEFAULT='N', SEQNO=NULL, STATUS='P', UPDATE_AVAILABLE=NULL, ISREGISTERED='N' WHERE STATUS IS NULL OR STATUS='I';
@@ -391,7 +391,7 @@
           DELETE FROM AD_SYSTEM;
           INSERT INTO AD_SYSTEM (AD_SYSTEM_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, TAD_RECORDRANGE, TAD_RECORDRANGE_INFO, TAD_TRANSACTIONALRANGE, TAD_THEME)
           VALUES ('0', '0', '0', 'Y', NOW(), '0', NOW(), '0', '?', 20, 100, 1, 'Default');
-          UPDATE AD_SYSTEM_INFO SET CODE_REVISION=${code.revision};
+          UPDATE AD_SYSTEM_INFO SET CODE_REVISION='${code.revision}';
           SELECT AD_UPDATE_SEQUENCE();
           SELECT AD_UPDATE_ACCESS();
           UPDATE AD_MODULE SET ISINDEVELOPMENT='N', ISDEFAULT='N', SEQNO=NULL, STATUS='P', UPDATE_AVAILABLE=NULL, ISREGISTERED='N' WHERE STATUS IS NULL OR STATUS='I';
Binary file src-db/database/lib/dbsourcemanager.jar has changed
--- a/src/org/openbravo/erpCommon/ad_forms/About.html	Fri May 08 13:36:52 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/About.html	Fri May 08 13:50:12 2009 +0200
@@ -92,7 +92,7 @@
             <td>
 
               <p class="Wide_Paragraph"><span class="Label_ReadOnly_Text">Openbravo <span id="paramVer">xx</span></span></p>
-              <p class="Wide_Paragraph">Copyright&nbsp;&copy;&nbsp;Openbravo, S.L.&nbsp;2001-2008</p>
+              <p class="Wide_Paragraph">Copyright&nbsp;&copy;&nbsp;Openbravo, S.L.&nbsp;2001-2009</p>
               <p class="Wide_Paragraph">This product has been created by Openbravo S.L. and is distributed under the <span class="LabelText"><a class="LabelLink_noicon" href="http://www.openbravo.com/legal/license.html" target="_blank">Openbravo Public License</a></span> (http://www.openbravo.com/legal/license.html)</p>
               <p class="Wide_Paragraph">This product incorporates software created by third parties and distributed under free software licenses, including:</p>
               <p class="Regular_Paragraph">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;ComPiere Inc.</p>
--- a/src/org/openbravo/erpCommon/ad_forms/About_data.xsql	Fri May 08 13:36:52 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/About_data.xsql	Fri May 08 13:50:12 2009 +0200
@@ -27,7 +27,7 @@
   <SqlMethod name="select" type="preparedStatement" return="multiple">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
-        SELECT AD_SYSTEM_INFO.OB_VERSION || ' (r' || AD_SYSTEM_INFO.CODE_REVISION || ')' AS VER, '' as LANG, '' as TRANSLATEDBY
+        SELECT AD_SYSTEM_INFO.OB_VERSION || ' (' || AD_SYSTEM_INFO.CODE_REVISION || ')' AS VER, '' as LANG, '' as TRANSLATEDBY
           FROM AD_SYSTEM_INFO
      </Sql>
    </SqlMethod>