Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-227

MicroKernel API: add depth parameter to diff method

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.4
    • mk
    • None

    Description

      a depth parameter allows to specify how deep changes should be included in the returned JSON diff.

      an example:

      // initial content (/test/foo)
      String rev0 = mk.commit("/", "+\"test\":{\"foo\":{}}", null, "");
      
      // add /test/foo/bar
      String rev1 = mk.commit("/test/foo", "+\"bar\":{\"p1\":123}", null, "");
      
      // modify property /test/foo/bar/p1
      String rev2 = mk.commit("/test/foo/bar", "^\"p1\":456", null, "");
      
      // diff with depth -1
      String diff0 = mk.diff(rev0, rev2, "/", -1);
      // returned +"/test/foo/bar":{"p1":456} 
      
      // diff with depth 5
      String diff1 = mk.diff(rev0, rev2, "/", 5);
      // returned +"/test/foo/bar":{"p1":456} 
      
      // diff with depth 1
      String diff2 = mk.diff(rev0, rev2, "/", 1);
      // returned ^"/test/foo", indicating that there are changes below /test/foo 
      
      // diff with depth 0
      String diff3 = mk.diff(rev0, rev2, "/", 0);
      // returned ^"/test", indicating that there are changes below /test 
      

      Attachments

        Activity

          People

            stefan@jira Stefan Guggisberg
            stefan@jira Stefan Guggisberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: