[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Adding empty files: change to svn_fs_make_file and documentation for the delta editor?

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2007-06-20 02:24:07 CEST

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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.