From 130fc61d7483dfb6d55f751c1040d3bb48af0ef1 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 27 Oct 2005 07:37:21 +0000 Subject: Printing out the revision of Version.java makes no sense. It's not always updated. Instead, determine the repository location that FOP was retrieved from. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@328820 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/Version.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/fop/Version.java b/src/java/org/apache/fop/Version.java index 229628348..221244d60 100644 --- a/src/java/org/apache/fop/Version.java +++ b/src/java/org/apache/fop/Version.java @@ -33,14 +33,20 @@ public class Version { String version = Version.class.getPackage().getImplementationVersion(); if (version == null) { //Fallback if FOP is used in a development environment - String revision = "$LastChangedRevision$"; - if (revision.indexOf(":") >= 0) { - revision = revision.substring(1, revision.length() - 2); - revision = ", revision" + revision.substring(revision.lastIndexOf(" ")); + String headURL + = "$HeadURL$"; + version = headURL; + final String pathPrefix = "/xmlgraphics/fop/"; + int pos = version.indexOf(pathPrefix); + if (pos >= 0) { + version = version.substring(pos + pathPrefix.length() - 1, version.length() - 2); + pos = version.indexOf("/src/"); + version = version.substring(1, pos); + version = " " + version; } else { - revision = ""; + version = ""; } - version = "SVN Trunk" + revision; + version = "SVN" + version; } return version; } -- cgit v1.2.3