ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1536528 - /ace/trunk/org.apache.ace.repository/src/org/apache/ace/repository/impl/RepositoryFactory.java
Date Mon, 28 Oct 2013 21:08:34 GMT
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);



Mime
View raw message