You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ja...@apache.org on 2013/10/28 22:08:34 UTC

svn commit: r1536528 - /ace/trunk/org.apache.ace.repository/src/org/apache/ace/repository/impl/RepositoryFactory.java

Author: jawi
Date: Mon Oct 28 21:08:33 2013
New Revision: 1536528

URL: http://svn.apache.org/r1536528
Log:
Be more careful when trying to commit the initial versions.

Modified:
    ace/trunk/org.apache.ace.repository/src/org/apache/ace/repository/impl/RepositoryFactory.java

Modified: ace/trunk/org.apache.ace.repository/src/org/apache/ace/repository/impl/RepositoryFactory.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.repository/src/org/apache/ace/repository/impl/RepositoryFactory.java?rev=1536528&r1=1536527&r2=1536528&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.repository/src/org/apache/ace/repository/impl/RepositoryFactory.java (original)
+++ ace/trunk/org.apache.ace.repository/src/org/apache/ace/repository/impl/RepositoryFactory.java Mon Oct 28 21:08:33 2013
@@ -213,7 +213,10 @@ public class RepositoryFactory implement
         RepositoryImpl store = new RepositoryImpl(dir, m_tempDir, fileExtension, isMaster, limitValue);
         if ((initialContents != null) && isMaster) {
             try {
-                store.commit(new ByteArrayInputStream(initialContents.getBytes()), 0);
+                // Do not even try to commit initial contents for existing repositories...
+                if (store.getRange().getHigh() == 0L) {
+                    store.commit(new ByteArrayInputStream(initialContents.getBytes()), 0L);
+                }
             }
             catch (IOException e) {
                 m_log.log(LogService.LOG_ERROR, "Unable to set initial contents of the repository.", e);