Agreed -- this is the way we do it for commits right now, AFAIRemember.
Greg Stein <firstname.lastname@example.org> writes:
> These changes don't make sense... the close_edit() is the key factor here.
> You want to call close_edit() just once per operation. So if you have
> multiple roots, then you must use editor navigation rather than ROOT_PATH.
> $ svn commit some/dir another/dir
> $ svn update some/dir another/dir
> The repository URL corresponding to "." is passed when the session is
> opened. Then you fetch the appropriate editor (no root path!). Then navigate
> down to each of "some/dir" and "another/dir" and start the commit/update
> operation. When both are complete, then you call close_edit().
> With the model below, you would expect the client to call
> get_commit_editor() twice -- once with "some/dir" and once with
> "another/dir", but then you lose the atomicity of the commit operation
> implied by the single close_edit() call.
> On Wed, Dec 20, 2000 at 07:24:10PM -0000, email@example.com wrote:
> > User: sussman
> > Date: 00/12/20 11:24:10
> > Modified: subversion/include svn_ra.h
> > Log:
> > Add some important parts to RA interface that we forgot, given the
> > way that editors work. Without these things, replace_root() would be
> > meaningless.
> > (get_commit_editor): the client must specify a ROOT_PATH in repository
> > that it plans to commit to. The EDIT_BATON handed back with the
> > editor has this knowledge.
> > (do_update): similarly, the client must supply a ROOT_PATH in the
> > repository that represents the topmost subdir in the working copy that
> > is being updated. The REPORT_BATON handed back should have this
> > knowledge.
> > Revision Changes Path
> > 1.23 +19 -10 subversion/subversion/include/svn_ra.h
> > Index: svn_ra.h
> > ===================================================================
> > RCS file: /cvs/subversion/subversion/include/svn_ra.h,v
> > retrieving revision 1.22
> > retrieving revision 1.23
> > diff -u -r1.22 -r1.23
> > --- svn_ra.h 2000/12/18 21:13:36 1.22
> > +++ svn_ra.h 2000/12/20 19:24:10 1.23
> > @@ -57,11 +57,12 @@
> > /* Return an *EDITOR and *EDIT_BATON capable of transmitting a
> > - commit to the repository. Also, ra's editor must guarantee that
> > - if close_edit() returns successfully, that *NEW_REVISION will be
> > - set to the repository's new revision number resulting from the
> > - commit. */
> > + commit to the repository beginning at absolute repository path
> > + ROOT_PATH. Also, ra's editor must guarantee that if close_edit()
> > + returns successfully, that *NEW_REVISION will be set to the
> > + repository's new revision number resulting from the commit. */
> > svn_error_t *(*get_commit_editor) (void *session_baton,
> > + svn_string_t *root_path,
> > const svn_delta_edit_fns_t **editor,
> > void **edit_baton,
> > svn_revnum_t *new_revision);
> > @@ -78,19 +79,27 @@
> > /* Ask the network layer to update a working copy from URL.
> > - The network layer returns a REPORT_EDITOR and REPORT_BATON to the
> > - client; the client then uses it to transmit an empty tree-delta
> > - to the repository which describes all revision numbers in the
> > - working copy.
> > + The client library provides a ROOT_PATH (absolute path within the
> > + repository) that represents to the topmost working copy subdir
> > + that will be updated. The client also provides an UPDATE_EDITOR
> > + (and baton) that can be used to modify the working copy.
> > +
> > + The network layer then returns a REPORT_EDITOR and REPORT_BATON
> > + to the client; the client first uses this to transmit an empty
> > + tree-delta to the repository which describes all revision numbers
> > + in the working copy.
> > There is one special property of the REPORT_EDITOR: its
> > close_edit() function. When the client calls close_edit(), the
> > network layer then talks to the repository and proceeds to use
> > - UPDATE_EDITOR and UPDATE_BATON to patch the working copy!
> > + UPDATE_EDITOR and UPDATE_BATON to patch the working copy.
> > When the update_editor->close_edit() returns, then
> > - report_editor->close_edit() returns too. */
> > + report_editor->close_edit() returns too. Therefore the return
> > + value of report_editor->close_edit() contains the result of the
> > + entire update. */
> > svn_error_t *(*do_update) (void *session_baton,
> > + svn_string_t *root_path,
> > const svn_delta_edit_fns_t **report_editor,
> > void **report_baton,
> > const svn_delta_edit_fns_t *update_editor,
> Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:17 2006