aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-10-27 07:37:21 +0000
committerJeremias Maerki <jeremias@apache.org>2005-10-27 07:37:21 +0000
commit130fc61d7483dfb6d55f751c1040d3bb48af0ef1 (patch)
tree5f98e338d754a7bc2297216c9809d72789cc8312
parentdf9bf92c17ece2e070acdfc170db06c9f185eaf1 (diff)
downloadxmlgraphics-fop-130fc61d7483dfb6d55f751c1040d3bb48af0ef1.tar.gz
xmlgraphics-fop-130fc61d7483dfb6d55f751c1040d3bb48af0ef1.zip
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
-rw-r--r--src/java/org/apache/fop/Version.java18
1 files 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;
}