jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1164466 - in /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk: MicroKernelImpl.java index/Indexer.java
Date Fri, 02 Sep 2011 10:33:13 GMT
Author: stefan
Date: Fri Sep  2 10:33:13 2011
New Revision: 1164466

URL: http://svn.apache.org/viewvc?rev=1164466&view=rev
Log:
fixed getJournal for negative ranges
fixed mk.indexDisabled flag

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java?rev=1164466&r1=1164465&r2=1164466&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
Fri Sep  2 10:33:13 2011
@@ -125,7 +125,23 @@ public class MicroKernelImpl implements 
 
         List<Commit> commits = new ArrayList<Commit>();
         try {
-            Commit commit = rep.getCommit(toRevisionId);
+            Commit toCommit = rep.getCommit(toRevisionId);
+
+            Commit fromCommit;
+            if (toRevisionId.equals(fromRevisionId)) {
+                fromCommit = toCommit;
+            } else {
+                fromCommit = rep.getCommit(fromRevisionId);
+                if (fromCommit.getCommitTS() > toCommit.getCommitTS()) {
+                    // negative range, return empty array
+                    return "[]";
+                }
+            }
+
+            // collect commits, starting with toRevisionId
+            // and traversing parent commit links until we've reached
+            // fromRevisionId
+            Commit commit = toCommit;
             while (commit != null) {
                 commits.add(commit);
                 if (commit.getId().equals(fromRevisionId)) {

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java?rev=1164466&r1=1164465&r2=1164466&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
Fri Sep  2 10:33:13 2011
@@ -33,7 +33,7 @@ import java.util.Iterator;
  */
 public class Indexer {
 
-    private static final boolean DISABLED = Boolean.parseBoolean("mk.indexDisabled");
+    private static final boolean DISABLED = Boolean.getBoolean("mk.indexDisabled");
 
     private MicroKernel mk;
     private String revision;



Mime
View raw message