sussman@tigris.org writes:
> Modified: trunk/subversion/include/svn_repos.h
> ==============================================================================
> --- OLD/trunk/subversion/include/svn_repos.h Sun Feb 3 22:59:37 2002
> +++ NEW/trunk/subversion/include/svn_repos.h Sun Feb 3 22:59:37 2002
> @@ -128,6 +128,12 @@
> TEXT_DELTAS instructs the driver of the EDITOR to enable to disable
> the generation of text deltas.
>
> + RECURSE instructs the driver of the EDITOR to send a recursive
> + delta (or not.)
> +
> + IS_SWITCH tells the driver of the EDITOR whether a pure update is
> + happening, or whether a 'switch' is happening.
> +
Hmmm, might be good to give some more detail on the IS_SWITCH
behavior.
For example, right above it the doc says "RECURSE instructs the driver
of the editor to send a recursive delta...", and that driver is
svn_repos_dir_delta() (according to even earlier in the doc string).
That phrasing works here because when one looks at dir_delta(), one
sees that it takes a `recurse' argument, so this is obviously a
pass-thru parameter.
But dir_delta does *not* take an `is_switch' flag, so the matched
phrasing is misleading. It's not clear exactly what IS_SWITCH does,
except that one can tell it's not a pass-thru... :-)
> +/* Drive EDITOR, sending a text-delta and prop-delta which converts
> + the file SRC_PATH/SRC_NAME into the file TGT_PATH, without doing a
> + replacement.
Just curious: is this driver actually promising to only call certain
of EDITOR's functions? (Such as, it will never invoke add or delete?)
> +svn_error_t *
> +svn_repos_switch_file (svn_fs_root_t *src_root,
> + const char *src_path,
> + const char *src_name,
> + apr_hash_t *src_revs,
> + svn_fs_root_t *tgt_root,
> + const char *tgt_path,
> + const svn_delta_edit_fns_t *editor,
> + void *edit_baton,
> + apr_pool_t *pool)
> +{
> + struct context c;
> + void *root_baton, *fb;
> + svn_stringbuf_t *src_full_path;
> + svn_revnum_t src_parent_rev, src_name_rev;
> +
> + c.editor = editor;
> + c.source_root = src_root;
> + c.target_root = tgt_root;
> + c.target_is_rev = svn_fs_is_revision_root (tgt_root);
> + c.recurse = TRUE;
> + c.text_deltas = TRUE;
> + c.source_rev_diffs = src_revs;
> +
> + /* Deduce revisions of src parent and child. */
> + src_full_path = svn_stringbuf_create (src_path, pool);
> + svn_path_add_component_nts (src_full_path, src_name);
> + src_parent_rev = get_revision_from_hash (src_revs,
> + src_full_path->data, pool);
> + src_name_rev = get_revision_from_hash (src_revs, src_name, pool);
> +
> + /* ### do a sanity check that src_full_path and tgt_path are
> + actually existent files. */
Actually, do we need a separate sanity check here? Won't certain
calls below simply error in the appropriate way if something's
missing?
> + /* Set the global target revision if the target is a revision. */
> + if (c.target_is_rev)
> + SVN_ERR (editor->set_target_revision
> + (edit_baton, svn_fs_revision_root_revision (tgt_root)));
> +
> + /* Start the edit. */
> + SVN_ERR (editor->open_root (edit_baton, src_parent_rev, &root_baton));
> +
> + /* Send a txdelta and propdelta */
> + SVN_ERR (editor->open_file (svn_stringbuf_create (src_name, pool),
> + root_baton, src_name_rev, &fb));
> + SVN_ERR (delta_files (&c, fb, src_full_path->data, tgt_path, pool));
> + SVN_ERR (editor->close_file (fb));
> +
> + /* Finish. */
> + SVN_ERR (editor->close_directory (root_baton));
> + SVN_ERR (editor->close_edit (edit_baton));
> +
> + return SVN_NO_ERROR;
> +}
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:04 2006