Author: hwright
Date: Mon Nov 21 22:36:48 2011
New Revision: 1204735
URL: http://svn.apache.org/viewvc?rev=1204735&view=rev
Log:
Ev2 shims: Handle the absent operations when converting from Ev2 to the delta
editor.
* subversion/libsvn_delta/compat.c
(operation): New operation.
(build): Handle the add absent action.
(add_absent_cb): Create an absent node in the operation tree.
(drive): Process the absent operation appropriately.
Modified:
subversion/trunk/subversion/libsvn_delta/compat.c
Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1204735&r1=1204734&r2=1204735&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Mon Nov 21 22:36:48 2011
@@ -719,6 +719,7 @@ struct operation {
OP_DELETE,
OP_ADD,
OP_REPLACE,
+ OP_ADD_ABSENT,
OP_PROPSET /* only for files for which no other operation is
occuring; directories are OP_OPEN with non-empty
props */
@@ -871,6 +872,9 @@ build(struct editor_baton *eb,
if (action == ACTION_DELETE)
operation->operation = OP_DELETE;
+ else if (action == ACTION_ADD_ABSENT)
+ operation->operation = OP_ADD_ABSENT;
+
/* Handle copy operations (which can be adds or replacements). */
else if (action == ACTION_COPY)
{
@@ -1012,6 +1016,10 @@ add_absent_cb(void *baton,
SVN_ERR(ensure_root_opened(eb));
+ SVN_ERR(build(eb, ACTION_ADD_ABSENT, relpath, kind,
+ NULL, SVN_INVALID_REVNUM,
+ NULL, NULL, SVN_INVALID_REVNUM, scratch_pool));
+
return SVN_NO_ERROR;
}
@@ -1236,6 +1244,15 @@ drive(const struct operation *operation,
&file_baton));
}
+ if (child->operation == OP_ADD_ABSENT)
+ {
+ if (child->kind == svn_kind_dir)
+ SVN_ERR(editor->absent_directory(path, operation->baton,
+ iterpool));
+ else
+ SVN_ERR(editor->absent_file(path, operation->baton, iterpool));
+ }
+
if (child->src_file && file_baton)
{
/* We need to change textual contents. */