diff BUGFIX reversing create and delete operations
They should be reverted as whole subtrees,
there can be no nested different operations.
Fixes #1446
diff --git a/src/diff.c b/src/diff.c
index ad72ed9..da4dfa9 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1673,10 +1673,16 @@
case LYD_DIFF_OP_CREATE:
/* reverse create to delete */
LY_CHECK_GOTO(ret = lyd_diff_change_op(elem, LYD_DIFF_OP_DELETE), cleanup);
+
+ /* the whole subtree was reversed, there can be no other operation there */
+ LYD_TREE_DFS_continue = 1;
break;
case LYD_DIFF_OP_DELETE:
/* reverse delete to create */
LY_CHECK_GOTO(ret = lyd_diff_change_op(elem, LYD_DIFF_OP_CREATE), cleanup);
+
+ /* the whole subtree was reversed, there can be no other operation there */
+ LYD_TREE_DFS_continue = 1;
break;
case LYD_DIFF_OP_REPLACE:
switch (elem->schema->nodetype) {