You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2002/12/01 23:27:37 UTC

Editor contract question

libsvn_repos/delta.c:delete() invokes editor->delete_entry with an
invalid revision argument:

  return c->editor->delete_entry (edit_path (c, path), SVN_INVALID_REVNUM, 
                                  dir_baton, pool);

The documentation for delete_entry is:

     Remove the directory entry named PATH, a child of the directory
     represented by PARENT_BATON.  REVISION is used as a sanity check
     to ensure that you are removing the revision of PATH that you
     really think you are.

There is no mention that REVISION can be invalid if the sanity check
is not required, so when I wrote my ra_svn code, I didn't make
allowances for passing an invalid revision.

Should I allow sanity-check revisions to be invalid (presumably in
open_directory and open_file as well as delete_entry) and change the
svn_delta documentation to match?  Or should we go to extra effort to
find the entry we're deleting in delta_dirs()?  (I think extra effort
is necessary; all we have is an entry name and a node ID.)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Editor contract question

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
[Sorry for the late response, Greg.  We had some mail server trouble,
and I'm just seeing some mails that were sent days ago.]

Greg Hudson <gh...@MIT.EDU> writes:
> libsvn_repos/delta.c:delete() invokes editor->delete_entry with an
> invalid revision argument:
> 
>   return c->editor->delete_entry (edit_path (c, path), SVN_INVALID_REVNUM, 
>                                   dir_baton, pool);
> 
> The documentation for delete_entry is:
> 
>      Remove the directory entry named PATH, a child of the directory
>      represented by PARENT_BATON.  REVISION is used as a sanity check
>      to ensure that you are removing the revision of PATH that you
>      really think you are.
> 
> There is no mention that REVISION can be invalid if the sanity check
> is not required, so when I wrote my ra_svn code, I didn't make
> allowances for passing an invalid revision.

I think that doc string should say that if REVISION is invalid, it is
ignored.  Same with open_directory and open_file.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org