jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r486694 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
Date Wed, 13 Dec 2006 15:47:56 GMT
Author: tripod
Date: Wed Dec 13 07:47:55 2006
New Revision: 486694

URL: http://svn.apache.org/viewvc?view=rev&rev=486694
Log:
JCR-529: New versions added after a restore have bad version name
--Tons added after a restore have bad version namesss line, and those below, will be ignored--

M    AbstractVersionManager.java

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java?view=diff&rev=486694&r1=486693&r2=486694
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
Wed Dec 13 07:47:55 2006
@@ -383,8 +383,13 @@
             String versionName = best.getName().getLocalName();
             int pos = versionName.lastIndexOf('.');
             if (pos > 0) {
-                versionName = versionName.substring(0, pos + 1)
+                String newVersionName = versionName.substring(0, pos + 1)
                     + (Integer.parseInt(versionName.substring(pos + 1)) + 1);
+                if (history.hasVersion(new QName("", newVersionName))) {
+                    versionName += ".1";
+            	} else {
+                    versionName = newVersionName;
+            	}
             } else {
                 versionName = String.valueOf(best.getSuccessors().length + 1) + ".0";
             }



Mime
View raw message