jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1328312 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/mk/client/ oak-core/src/main/java/org/apache/jackrabbit/mk/server/ oak-core/src/main/java/org/apache/jackrabbit/mk/simple/ oak-core/src/main/java/org/apache/j...
Date Fri, 20 Apr 2012 10:45:10 GMT
Author: stefan
Date: Fri Apr 20 10:45:08 2012
New Revision: 1328312

URL: http://svn.apache.org/viewvc?rev=1328312&view=rev
Log:
OAK-11: Document and tighten contract of Microkernel API

revised javadoc of api
renamed getRevisions to getRevisionHistory to better distinguish it from getJournal
getRevisionHistory now also returns commit msg
updated experimental mk web ui

Added:
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/branch.html
      - copied, changed from r1327966, jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/commit.html
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getChildNodeCount.html
      - copied, changed from r1327966, jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getLength.html
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisionHistory.html
  (contents, props changed)
      - copied, changed from r1327966, jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisions.html
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/merge.html
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisions.html
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/Revision.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/LogWrapper.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/MicroKernelWrapperBase.java
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/diff.html
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getJournal.html
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getNodes.html
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/index.html
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/MoveNodeIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/concurrent/ConcurrentTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/MoveNodeIT.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/client/Client.java
Fri Apr 20 10:45:08 2012
@@ -115,13 +115,13 @@ public class Client implements MicroKern
         }
     }
 
-    public synchronized String getRevisions(long since, int maxEntries)
+    public synchronized String getRevisionHistory(long since, int maxEntries)
             throws MicroKernelException {
 
         Request request = null;
 
         try {
-            request = createRequest("getRevisions");
+            request = createRequest("getRevisionHistory");
             request.addParameter("since", since);
             request.addParameter("max_entries", maxEntries);
             return request.getString();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
Fri Apr 20 10:45:08 2012
@@ -74,7 +74,7 @@ class MicroKernelServlet {
 
     static {
         COMMANDS.put("getHeadRevision", new GetHeadRevision());
-        COMMANDS.put("getRevisions", new GetRevisions());
+        COMMANDS.put("getRevisionHistory", new GetRevisionHistory());
         COMMANDS.put("waitForCommit", new WaitForCommit());
         COMMANDS.put("getJournal", new GetJournal());
         COMMANDS.put("diff", new Diff());
@@ -99,7 +99,7 @@ class MicroKernelServlet {
         }        
     }
 
-    static class GetRevisions implements Command {
+    static class GetRevisionHistory implements Command {
         
         public void execute(MicroKernel mk, Request request, Response response)
                 throws IOException, MicroKernelException {
@@ -108,7 +108,7 @@ class MicroKernelServlet {
             int maxEntries = request.getParameter("max_entries", 10);
 
             response.setContentType("application/json");
-            String json = mk.getRevisions(since, maxEntries);
+            String json = mk.getRevisionHistory(since, maxEntries);
             if (request.getHeaders().containsKey("User-Agent")) {
                 json = JsopBuilder.prettyPrint(json);
             }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/Revision.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/Revision.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/Revision.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/Revision.java
Fri Apr 20 10:45:08 2012
@@ -105,6 +105,7 @@ public class Revision implements Compara
         return new JsopBuilder().object().
             key("id").value(formatId(id)).
             key("ts").value(nanos / 1000000).
+            key("msg").value(getMsg()).
         endObject().toString();
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/LogWrapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/LogWrapper.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/LogWrapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/LogWrapper.java
Fri Apr 20 10:45:08 2012
@@ -132,10 +132,10 @@ public class LogWrapper implements Micro
         }
     }
 
-    public String getRevisions(long since, int maxEntries) {
+    public String getRevisionHistory(long since, int maxEntries) {
         try {
-            logMethod("getRevisions", since, maxEntries);
-            String result = mk.getRevisions(since, maxEntries);
+            logMethod("getRevisionHistory", since, maxEntries);
+            String result = mk.getRevisionHistory(since, maxEntries);
             logResult(result);
             return result;
         } catch (Exception e) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/MicroKernelWrapperBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/MicroKernelWrapperBase.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/MicroKernelWrapperBase.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/wrapper/MicroKernelWrapperBase.java
Fri Apr 20 10:45:08 2012
@@ -59,7 +59,7 @@ public abstract class MicroKernelWrapper
         return diffStream(fromRevisionId, toRevisionId, filter).toString();
     }
 
-    public final String getRevisions(long since, int maxEntries) {
+    public final String getRevisionHistory(long since, int maxEntries) {
         return getRevisionsStream(since, maxEntries).toString();
     }
 
@@ -106,7 +106,7 @@ public abstract class MicroKernelWrapper
             }
 
             public JsopReader getRevisionsStream(long since, int maxEntries) {
-                return new JsopTokenizer(wrapped.getRevisions(since, maxEntries));
+                return new JsopTokenizer(wrapped.getRevisionHistory(since, maxEntries));
             }
 
             public JsopReader diffStream(String fromRevisionId, String toRevisionId, String
path) {
@@ -153,8 +153,8 @@ public abstract class MicroKernelWrapper
                 return wrapped.getNodes(path, revisionId, depth, offset, count, filter);
             }
 
-            public String getRevisions(long since, int maxEntries) {
-                return wrapped.getRevisions(since, maxEntries);
+            public String getRevisionHistory(long since, int maxEntries) {
+                return wrapped.getRevisionHistory(since, maxEntries);
             }
 
             public boolean nodeExists(String path, String revisionId) {

Copied: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/branch.html
(from r1327966, jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/commit.html)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/branch.html?p2=jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/branch.html&p1=jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/commit.html&r1=1327966&r2=1328312&rev=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/commit.html
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/branch.html
Fri Apr 20 10:45:08 2012
@@ -1,6 +1,6 @@
 <html>
 <head>
-<title>&micro;Kernel prototype: commit</title>
+<title>&micro;Kernel prototype: branch</title>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
 <link rel="stylesheet" type="text/css" href="main.css"/>
 </head>
@@ -8,26 +8,12 @@
 <body>
     <script src="header.js"></script>
     <div class="content">
-        <h1>Write Operations: commit</h1>
+        <h1>Write Operations: branch</h1>
         <form method="POST" target="result">
         <table class="formtable">
             <tr>
-                <td>Path</td>
-                <td><input class="text" type="text" name="path" id="path" value="/"></td>
-            </tr>
-            <tr>
-                <td>JSON Diff</td>
-                <td><input class="text" type="text" name="json_diff" id="json_diff"
-                   value='+"test" : {"jcr:primaryType":"nt:unstructured"}'>
-                </td>
-            </tr>
-            <tr>
-                <td>Revision ID</td>
-                <td><input class="text" type="text" name="revision_id" id="revision_id"
value=""></td>
-            </tr>
-            <tr>
-                <td>Message</td>
-                <td><input class="text" type="text" name="message" id="message"
value=""></td>
+                <td>Trunk Revision ID</td>
+                <td><input class="text" type="text" name="trunk_revision_id" id="trunk_revision_id"
value=""></td>
             </tr>
             <tr><td>&nbsp;</td><td>
             <input type="submit"><br></td></tr></table>

Modified: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/diff.html
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/diff.html?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/diff.html
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/diff.html
Fri Apr 20 10:45:08 2012
@@ -20,8 +20,8 @@
                 <td><input class="text" type="text" name="to_revision_id" id="to_revision_id"
value=""></td>
             </tr>
             <tr>
-                <td>Path</td>
-                <td><input class="text" type="text" name="path" id="path" value=""></td>
+                <td>Filter</td>
+                <td><input class="text" type="text" name="filter" id="filter" value=""></td>
             </tr>
             <tr><td>&nbsp;</td><td>
             <input type="submit"><br></td></tr></table>

Copied: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getChildNodeCount.html
(from r1327966, jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getLength.html)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getChildNodeCount.html?p2=jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getChildNodeCount.html&p1=jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getLength.html&r1=1327966&r2=1328312&rev=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getLength.html
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getChildNodeCount.html
Fri Apr 20 10:45:08 2012
@@ -8,12 +8,16 @@
 <body>
     <script src="header.js"></script>
     <div class="content">
-        <h1>Blob Operations: getLength</h1>
+        <h1>Read Operations: getChildNodeCount</h1>
         <form method="POST" target="result">
         <table class="formtable">
             <tr>
-                <td>Blob ID</td>
-                <td><input class="text" type="text" name="blob_id" id="blob_id"
value=""></td>
+                <td>Path</td>
+                <td><input class="text" type="text" name="path" id="path" value="/"></td>
+            </tr>
+            <tr>
+                <td>Revision ID</td>
+                <td><input class="text" type="text" name="revision_id" id="revision_id"
value=""></td>
             </tr>
             <tr><td>&nbsp;</td><td>
             <input type="submit"><br></td></tr></table>

Modified: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getJournal.html
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getJournal.html?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getJournal.html
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getJournal.html
Fri Apr 20 10:45:08 2012
@@ -19,6 +19,10 @@
                 <td>To Revision ID</td>
                 <td><input class="text" type="text" name="to_revision_id" id="to_revision_id"
value=""></td>
             </tr>
+            <tr>
+                <td>Filter</td>
+                <td><input class="text" type="text" name="filter" id="filter" value=""></td>
+            </tr>
             <tr><td>&nbsp;</td><td>
             <input type="submit"><br></td></tr></table>
         </form>

Modified: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getNodes.html
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getNodes.html?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getNodes.html
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getNodes.html
Fri Apr 20 10:45:08 2012
@@ -31,6 +31,10 @@
                 <td>Count</td>
                 <td><input class="text" type="text" name="count" id="count" value="-1"></td>
             </tr>
+            <tr>
+                <td>Filter</td>
+                <td><input class="text" type="text" name="filter" id="filter" value=""></td>
+            </tr>
             <tr><td>&nbsp;</td><td>
             <input type="submit"><br></td></tr></table>
         </form>

Copied: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisionHistory.html
(from r1327966, jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisions.html)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisionHistory.html?p2=jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisionHistory.html&p1=jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisions.html&r1=1327966&r2=1328312&rev=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisions.html
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisionHistory.html
Fri Apr 20 10:45:08 2012
@@ -1,6 +1,6 @@
 <html>
 <head>
-<title>&micro;Kernel prototype: getRevisions</title>
+<title>&micro;Kernel prototype: getRevisionHistory</title>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
 <link rel="stylesheet" type="text/css" href="main.css"/>
 </head>
@@ -8,7 +8,7 @@
 <body>
     <script src="header.js"></script>
     <div class="content">
-        <h1>Revision Operations: getRevisions</h1>
+        <h1>Revision Operations: getRevisionHistory</h1>
         <form method="POST" target="result">
         <table class="formtable">
             <tr>

Propchange: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/getRevisionHistory.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/index.html
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/index.html?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/index.html
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/index.html
Fri Apr 20 10:45:08 2012
@@ -11,7 +11,7 @@
         <p>
         <h4>Revision Operations</h4>
         <a href="getHeadRevision.html">getHeadRevision</a><br>
-        <a href="getRevisions.html">getRevisions</a><br>
+        <a href="getRevisionHistory.html">getRevisionHistory</a><br>
         <a href="waitForCommit.html">waitForCommit</a><br>
         <a href="getJournal.html">getJournal</a><br>
         <a href="diff.html">diff</a><br>
@@ -19,9 +19,12 @@
         <h4>Read Operations</h4>
         <a href="nodeExists.html">nodeExists</a><br>
         <a href="getNodes.html">getNodes</a><br>
+        <a href="getChildNodeCount.html">getChildNodeCount</a><br>
 
         <h4>Write Operations</h4>
         <a href="commit.html">commit</a><br>
+        <a href="branch.html">branch</a><br>
+        <a href="merge.html">merge</a><br>
 
         <h4>Blob Operations</h4>
         <a href="getLength.html">getLength</a><br>

Added: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/merge.html
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/merge.html?rev=1328312&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/merge.html
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/mk/server/merge.html
Fri Apr 20 10:45:08 2012
@@ -0,0 +1,31 @@
+<html>
+<head>
+<title>&micro;Kernel prototype: branch</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<link rel="stylesheet" type="text/css" href="main.css"/>
+</head>
+
+<body>
+    <script src="header.js"></script>
+    <div class="content">
+        <h1>Write Operations: merge</h1>
+        <form method="POST" target="result">
+        <table class="formtable">
+            <tr>
+                <td>Branch Revision ID</td>
+                <td><input class="text" type="text" name="branch_revision_id" id="branch_revision_id"
value=""></td>
+            </tr>
+            <tr>
+                <td>Message</td>
+                <td><input class="text" type="text" name="message" id="message"
value=""></td>
+            </tr>
+            <tr><td>&nbsp;</td><td>
+            <input type="submit"><br></td></tr></table>
+        </form>
+        <p>
+            <iframe name="result" height="400" width="950" src="about:blank"></iframe>
+        </p>
+        <script src="footer.js"></script>
+    </div>
+</body>
+</html>

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
Fri Apr 20 10:45:08 2012
@@ -71,7 +71,7 @@ public class ConcurrentWriteIT extends T
         System.out.println("new HEAD: " + head);
         System.out.println();
 
-        String history = mk.getRevisions(t0, -1);
+        String history = mk.getRevisionHistory(t0, -1);
         System.out.println("History:");
         System.out.println(history);
         System.out.println();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/MoveNodeIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/MoveNodeIT.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/MoveNodeIT.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/MoveNodeIT.java Fri
Apr 20 10:45:08 2012
@@ -80,7 +80,7 @@ public class MoveNodeIT extends MultiMkT
 
     private String getJournal() {
         if (journalRevision == null) {
-            String revs = mk.getRevisions(0, 1);
+            String revs = mk.getRevisionHistory(0, 1);
             JsopTokenizer t = new JsopTokenizer(revs);
             t.read('[');
             do {
@@ -92,6 +92,10 @@ public class MoveNodeIT extends MultiMkT
                 Assert.assertEquals("ts", t.readString());
                 t.read(':');
                 t.read(JsopTokenizer.NUMBER);
+                t.read(',');
+                Assert.assertEquals("msg", t.readString());
+                t.read(':');
+                t.read();
                 t.read('}');
             } while (t.matches(','));
         }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/concurrent/ConcurrentTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/concurrent/ConcurrentTest.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/concurrent/ConcurrentTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/concurrent/ConcurrentTest.java
Fri Apr 20 10:45:08 2012
@@ -41,7 +41,7 @@ public class ConcurrentTest extends Mult
                 String newRev = mk.commit("/", "+\"" + i + "\":{\"x\": " + i + "}", rev,
"");
                 Assert.assertTrue(!newRev.equals(rev));
                 mk.getJournal(rev, newRev, null);
-                mk.getRevisions(start, 100);
+                mk.getRevisionHistory(start, 100);
                 mk.getNodes("/" + i, newRev);
                 mk.getNodes("/" + i, newRev, 0, 0, 0, null);
                 Assert.assertFalse(mk.nodeExists("/" + i, rev));

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/MoveNodeIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/MoveNodeIT.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/MoveNodeIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/MoveNodeIT.java
Fri Apr 20 10:45:08 2012
@@ -259,7 +259,7 @@ public class MoveNodeIT {
 
     private String getJournal() {
         if (journalRevision == null) {
-            String revs = mk.getRevisions(0, 1);
+            String revs = mk.getRevisionHistory(0, 1);
             JsopTokenizer t = new JsopTokenizer(revs);
             t.read('[');
             do {
@@ -271,6 +271,10 @@ public class MoveNodeIT {
                 Assert.assertEquals("ts", t.readString());
                 t.read(':');
                 t.read(JsopTokenizer.NUMBER);
+                t.read(',');
+                Assert.assertEquals("msg", t.readString());
+                t.read(':');
+                t.read();
                 t.read('}');
             } while (t.matches(','));
         }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
Fri Apr 20 10:45:08 2012
@@ -62,21 +62,29 @@ public interface MicroKernel {
     String getHeadRevision() throws MicroKernelException;
 
     /**
-     * Returns a chronological list of all revisions since a specific point
-     * in time.
+     * Returns a list of all currently available (historical) head revisions in
+     * chronological order since a specific point. <i>Private</i> branch
+     * revisions won't be included in the result.
      * <p/>
      * Format:
      * <pre>
-     * [ { "id" : "<revisionId>", "ts" : <revisionTimestamp> }, ... ]
+     * [
+     *   {
+     *     "id" : "&lt;revisionId&gt;",
+     *     "ts" : &lt;revisionTimestamp&gt;,
+     *     "msg" : "&lt;commitMessage&gt;"
+     *   },
+     *   ...
+     * ]
      * </pre>
      *
      * @param since      timestamp (ms) of earliest revision to be returned
      * @param maxEntries maximum #entries to be returned;
      *                   if < 0, no limit will be applied.
-     * @return a chronological list of revisions in JSON format.
+     * @return a list of revisions in chronological order in JSON format.
      * @throws MicroKernelException if an error occurs
      */
-    String /* jsonArray */ getRevisions(long since, int maxEntries)
+    String /* jsonArray */ getRevisionHistory(long since, int maxEntries)
             throws MicroKernelException;
 
     /**
@@ -91,18 +99,20 @@ public interface MicroKernel {
      * will return immediately, i.e. calling {@code waitForCommit(0)} is
      * equivalent to calling {@code getHeadRevision()}.
      *
-     * @param oldHeadRevisionId id of previous head revision
+     * @param oldHeadRevisionId id of earlier head revision
      * @param timeout the maximum time to wait in milliseconds
      * @return the id of the head revision
      * @throws MicroKernelException if an error occurs
      * @throws InterruptedException if the thread was interrupted
      */
-    String waitForCommit(String oldHeadRevisionId, long timeout) throws MicroKernelException,
InterruptedException;
+    String waitForCommit(String oldHeadRevisionId, long timeout)
+            throws MicroKernelException, InterruptedException;
 
     /**
      * Returns a revision journal, starting with {@code fromRevisionId}
-     * and ending with {@code toRevisionId} in ascending chronological order
-     * the revision denoted by {@code fromRevisionId} is expected to be older
+     * and ending with {@code toRevisionId} in chronological order.
+     * <p/>
+     * The revision denoted by {@code fromRevisionId} is expected to be older
      * i.e. than the one denoted by {@code toRevisionId});
      * <p/>
      * Format:
@@ -110,7 +120,7 @@ public interface MicroKernel {
      * [
      *   {
      *     "id" : "&lt;revisionId&gt;",
-     *     "ts" : "&lt;revisionTimestamp&gt;",
+     *     "ts" : &lt;revisionTimestamp&gt;,
      *     "msg" : "&lt;commitMessage&gt;",
      *     "changes" : "&lt;JSON diff&gt;"
      *   },
@@ -250,7 +260,9 @@ public interface MicroKernel {
      * @return node tree in JSON format or {@code null} if the specified node does not exist
      * @throws MicroKernelException if the specified revision does not exist or if another
error occurs
      */
-    String /* jsonTree */ getNodes(String path, String revisionId, int depth, long offset,
int count, String filter) throws MicroKernelException;
+    String /* jsonTree */ getNodes(String path, String revisionId, int depth,
+                                   long offset, int count, String filter)
+            throws MicroKernelException;
 
     //------------------------------------------------------------< WRITE ops >
 
@@ -273,7 +285,8 @@ public interface MicroKernel {
      * @return id of newly created revision
      * @throws MicroKernelException if an error occurs
      */
-    String /* revisionId */ commit(String path, String jsonDiff, String revisionId, String
message)
+    String /* revisionId */ commit(String path, String jsonDiff,
+                                   String revisionId, String message)
             throws MicroKernelException;
 
     /**
@@ -282,8 +295,8 @@ public interface MicroKernel {
      * <p/>
      * A {@code MicroKernelException} is thrown if {@code trunkRevisionId} doesn't
      * exist, if it's not a <i>trunk</i> revision (i.e. it's not reachable
-     * by traversing the revision history backwards starting from the current
-     * head revision) or if another error occurs.
+     * by traversing the revision history in reverse chronological order starting
+     * from the current head revision) or if another error occurs.
      *
      * @param trunkRevisionId id of public trunk revision to base branch on,
      *                        if {@code null} the current head revision is assumed

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Fri Apr 20 10:45:08 2012
@@ -108,7 +108,7 @@ public class MicroKernelImpl implements 
         }
     }
 
-    public String getRevisions(long since, int maxEntries) throws MicroKernelException {
+    public String getRevisionHistory(long since, int maxEntries) throws MicroKernelException
{
         if (rep == null) {
             throw new IllegalStateException("this instance has already been disposed");
         }
@@ -137,6 +137,7 @@ public class MicroKernelImpl implements 
             buff.object().
                     key("id").value(commit.getId().toString()).
                     key("ts").value(commit.getCommitTS()).
+                    key("msg").value(commit.getMsg()).
                     endObject();
         }
         return buff.endArray().toString();
@@ -209,10 +210,22 @@ public class MicroKernelImpl implements 
         // TODO extract and evaluate filter criteria (such as e.g. 'path') specified in 'filter'
parameter
         String path = "/";
 
-        Id toRevisionId = toRevision == null ? getHeadRevisionId() : Id.fromString(toRevision);
+        Id fromRevisionId, toRevisionId;
+        if (fromRevision == null || toRevision == null) {
+            Id head = getHeadRevisionId();
+            fromRevisionId = fromRevision == null ? head : Id.fromString(fromRevision);
+            toRevisionId = toRevision == null ? head : Id.fromString(toRevision);
+        } else {
+            fromRevisionId = Id.fromString(fromRevision);
+            toRevisionId = Id.fromString(toRevision);
+        }
+
+        if (fromRevisionId.equals(toRevisionId)) {
+            return "";
+        }
 
         try {
-            NodeState before = rep.getNodeState(Id.fromString(fromRevision), path);
+            NodeState before = rep.getNodeState(fromRevisionId, path);
             NodeState after = rep.getNodeState(toRevisionId, path);
 
             return new DiffBuilder(before, after, path, rep.getRevisionStore(), filter).build();

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java?rev=1328312&r1=1328311&r2=1328312&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
Fri Apr 20 10:45:08 2012
@@ -68,7 +68,7 @@ public class ConcurrentWriteIT extends T
         String head = mk.getHeadRevision();
         mk.getNodes("/", head, Integer.MAX_VALUE, 0, -1, null);
 
-        String history = mk.getRevisions(t0, -1);
+        String history = mk.getRevisionHistory(t0, -1);
 
         mk.getJournal(oldHead, head, null);
     }



Mime
View raw message