David Glasser wrote:
> So Ben brought up a bizarre bug on #svn-dev today. A user was using
> svnsync to copy his project to Google Code, and zero-length files were
> not being created on the destination.
[...]
> I propose the attached two patches. What do you think?
>
> [[[
> The DAV-based RA commit editors have always assumed that
> apply_textdelta will be called on all copied files, even empty ones,
> and the client commit driver has always done so; document this
> as an explicit requirement for driving a delta editor.
>
>
> * subversion/include/svn_delta.h
> (add_file): Explicitly state that you need to call apply_textdelta
> for new uncopied files.
> ]]]
This seems like a really random thing to require. It would be much nicer to
editor drivers for us to change those two editors to, open getting a
close_file() with no intermediate apply_textdelta(), perform the empty
apply_textdelta() behavior on the caller's behalf.
> [[[
> Ensure that new uncopied files always have the text-modification flag
> set, even if they are empty.
>
> Previously, empty files created with "svn commit" or "svnadmin load"
> would always have the text-modification flag set, but direct usage of
> the svn_fs_make_file API would leave the flag unset; this led to
> issues such as svn_repos_replay2 not sending an apply_textdelta for
> them.
>
> * subversion/libsvn_fs_base/tree.c
> (txn_body_make_file): Pass true value for text-modifications flag in
> the call to add_change.
>
> * subversion/libsvn_fs_fs/tree.c
> (fs_make_file): Pass true value for text-modifications flag in
> the call to add_change.
> ]]]
Definitely +1 on this. As the author of that changes table support, I can
tell you that it was always assumed that a new file's text_mods bit would be
set. That it wasn't is a coding error.
--
C. Michael Pilato <cmpilato@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Received on Wed Jun 20 02:24:05 2007