[
https://issues.apache.org/jira/browse/OAK-227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Guggisberg updated OAK-227:
----------------------------------
Description:
a depth parameter allows to specify how deep changes should be included in the
returned JSON diff.
an example:
{code}
// 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
{code}
was:
a depth parameter allows to specify how deep changes should be included in the
returned JSON diff.
an example:
{code}
// 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 5
String diff1 = mk.diff(rev0, rev2, "/", 5);
// returned +"/test/foo/bar":{"p1":456}
// diff with depth 1
String diff1 = mk.diff(rev0, rev2, "/", 1);
// returned ^"/test", indicating that there are changes below /test
{code}
> MicroKernel API: add depth parameter to diff method
> ---------------------------------------------------
>
> Key: OAK-227
> URL: https://issues.apache.org/jira/browse/OAK-227
> Project: Jackrabbit Oak
> Issue Type: New Feature
> Components: mk
> Reporter: Stefan Guggisberg
> Assignee: Stefan Guggisberg
>
> a depth parameter allows to specify how deep changes should be included in
> the returned JSON diff.
> an example:
> {code}
> // 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
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira