[Jython-checkins] jython (2.5): remove svn version support, hardcode sys.subversion

philip.jenvey jython-checkins at python.org
Sun May 8 00:09:09 CEST 2011


http://hg.python.org/jython/rev/250d80c48c23
changeset:   6203:250d80c48c23
branch:      2.5
parent:      6201:6addc109c69c
user:        Philip Jenvey <pjenvey at underboss.org>
date:        Sat May 07 15:04:50 2011 -0700
summary:
  remove svn version support, hardcode sys.subversion

files:
  build.xml                              |  19 +---
  src/org/python/Version.java            |  79 +-------------
  src/org/python/core/PySystemState.java |   3 +-
  3 files changed, 7 insertions(+), 94 deletions(-)


diff --git a/build.xml b/build.xml
--- a/build.xml
+++ b/build.xml
@@ -421,28 +421,12 @@
         </exec>
     </target>
 
-    <target name="svnversion-check" depends="check-hg">
-      <condition property="svnversion-run">
-        <and>
-          <not>
-            <isset property="hg.present"/>
-          </not>
-          <!-- XXX: could attempt to utilize subwcrev.exe to get the revision on Windows  -->
-          <isset property="os.family.unix"/>
-        </and>
-      </condition>
-    </target>
-    <target name="svnversion" depends="svnversion-check" if="svnversion-run">
-        <exec executable="svnversion" failifexecutionfails="false" outputproperty="build.svn.revision"/>
-    </target>
-
     <!-- skip-brand can be set in ant.properties or as a system property to keep from updating the
          version.properties file and making the jar on every developer build. -->
-    <target name="brand-version" depends="init, hg-id, svnversion" unless="skip-brand">
+    <target name="brand-version" depends="init, hg-id" unless="skip-brand">
         <property name="build.hg.branch" value=""/>
         <property name="build.hg.tag" value=""/>
         <property name="build.hg.version" value=""/>
-        <property name="build.svn.revision" value=""/>
         <tstamp>
             <format property="build.date" pattern="MMM d yyyy" offset="0"/>
             <format property="build.time" pattern="HH:mm:ss" offset="0"/>
@@ -457,7 +441,6 @@
 jython.release_serial=${jython.release_serial}
 jython.build.date=${build.date}
 jython.build.time=${build.time}
-jython.build.svn_revision=${build.svn.revision}
 jython.build.hg_branch=${build.hg.branch}
 jython.build.hg_tag=${build.hg.tag}
 jython.build.hg_version=${build.hg.version}</echo>
diff --git a/src/org/python/Version.java b/src/org/python/Version.java
--- a/src/org/python/Version.java
+++ b/src/org/python/Version.java
@@ -30,19 +30,9 @@
     public static int PY_RELEASE_LEVEL;
     public static int PY_RELEASE_SERIAL;
 
-    /** Timestamp and revision number of the current build. */
+    /** Timestamp of the current build. */
     public static String DATE;
     public static String TIME;
-    public static String SVN_REVISION;
-    /** Current hg global revision id (hg id -i). */
-    public static String HG_VERSION;
-
-    /** Determined from headURL, branch is the path under the
-     * subversion root, e.g. branches/asm. */
-    public static String BRANCH;
-
-    /** Short version of branch, e.g. asm. */
-    public static String SHORT_BRANCH;
 
     /** Current hg branch (hg id -b). */
     public static String HG_BRANCH;
@@ -50,44 +40,15 @@
     /** Current hg tag (hg id -t), e.g. 'tip'. */
     public static String HG_TAG;
 
+    /** Current hg global revision id (hg id -i). */
+    public static String HG_VERSION;
+
     /** The flags that are set by default in a code object. */
     private static final Collection<CodeFlag> defaultCodeFlags = Arrays.asList(
             CodeFlag.CO_NESTED, CodeFlag.CO_GENERATOR_ALLOWED);
 
-    private static final String headURL =
-            "$HeadURL$";
-
     static {
-        initVersion();
-    }
-
-    /**
-     * Load the version information and determine BRANCH and
-     * SHORT_BRANCH from headURL.
-     */
-    private static void initVersion() {
         loadProperties();
-
-        int jython = headURL.indexOf("/jython/");
-        if (jython > -1) {
-            int brStart = jython + 8;
-            String end = headURL.substring(brStart, headURL.length());
-
-            if (end.startsWith("trunk/")) {
-                BRANCH = SHORT_BRANCH = "trunk";
-                return;
-            } else if (end.startsWith("tags/") || end.startsWith("branches/")) {
-                int brEnd = end.indexOf('/');
-                int brEnd2 = end.indexOf('/', brEnd + 1);
-                if (brEnd2 > -1) {
-                    BRANCH = end.substring(0, brEnd2);
-                    SHORT_BRANCH = end.substring(brEnd + 1, brEnd2);
-                    return;
-                }
-            }
-        }
-        BRANCH = "";
-        SHORT_BRANCH = "unknown";
     }
 
     /**
@@ -110,7 +71,6 @@
                 PY_RELEASE_SERIAL = Integer.valueOf(properties.getProperty("jython.release_serial"));
                 DATE = properties.getProperty("jython.build.date");
                 TIME = properties.getProperty("jython.build.time");
-                SVN_REVISION = properties.getProperty("jython.build.svn_revision");
                 HG_BRANCH = properties.getProperty("jython.build.hg_branch");
                 HG_TAG = properties.getProperty("jython.build.hg_tag");
                 HG_VERSION = properties.getProperty("jython.build.hg_version");
@@ -133,21 +93,6 @@
     }
 
     /**
-     * Return the current subversion revision number. May be an empty
-     * string on environments that can't determine it.
-     */
-    public static String getSubversionRevision() {
-        return SVN_REVISION;
-    }
-
-    /**
-     * Return the current branch name.
-     */
-    public static String getSubversionShortBranch() {
-        return SHORT_BRANCH;
-    }
-
-    /**
      * Return the current hg version number. May be an empty string on environments that
      * can't determine it.
      */
@@ -163,23 +108,9 @@
     }
 
     /**
-     * Return the current build information, including revision and
-     * timestamp.
+     * Return the current build information, including revision and timestamp.
      */
     public static String getBuildInfo() {
-        if (HG_VERSION != null && !"".equals(HG_VERSION)) {
-            return getBuildInfoHG();
-        }
-        String revision = getSubversionRevision();
-        String sep = "".equals(revision) ? "" : ":";
-        String branch = getSubversionShortBranch();
-        return String.format("%s%s%s, %.20s, %.9s", branch, sep, revision, DATE, TIME);
-    }
-
-    /**
-     * Return the current build information, including revision and timestamp.
-     */
-    public static String getBuildInfoHG() {
         String revision = getHGVersion();
         String sep = "".equals(revision) ? "" : ":";
         String hgId = getHGIdentifier();
diff --git a/src/org/python/core/PySystemState.java b/src/org/python/core/PySystemState.java
--- a/src/org/python/core/PySystemState.java
+++ b/src/org/python/core/PySystemState.java
@@ -946,8 +946,7 @@
                                    Py.newInteger(Version.PY_MICRO_VERSION),
                                    Py.newString(s),
                                    Py.newInteger(Version.PY_RELEASE_SERIAL));
-        subversion = new PyTuple(Py.newString("Jython"), Py.newString(Version.BRANCH),
-                                 Py.newString(Version.SVN_REVISION));
+        subversion = new PyTuple(Py.newString("Jython"), Py.EmptyString, Py.EmptyString);
         _mercurial = new PyTuple(Py.newString("Jython"), Py.newString(Version.getHGIdentifier()),
                                  Py.newString(Version.getHGVersion()));
     }

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list