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

Re: Crazy 5-step plan to remove the cached pristine copy

From: Benjamin Pflugmann <benjamin-svn-dev_at_pflugmann.de>
Date: 2003-03-24 20:07:30 CET

Hi.

On Sun 2003-03-23 at 21:37:47 -0600, Florin Iucha wrote:
> 0. (Might exist already) Store in the .svn admin area checksums of the
> base copies.

0b. As an intermediate step assure that all places using the prestine
    base copy do something sensible when it is missing (probably give
    a reasonable error). Also a good way to get an overview what code
    will be affected by the following changes.

> 1. Tweak libsvn_wc/diff.c:file_diff to fetch a pristine copy from the
> server if a cached base version is not available. The downloaded
> pristine copy should be cached.

From the little bit I know about the code, I fear that this part is
going to be more complicated than it sounds at first.

> 2. Add a "--no-base-copy" option to "svn checkout".
>
> 3. Add a "prepare-edit" command to "svn" that will copy the
> working copy into the base copy (if the checksums match).
>
> 4. Add a cleanup-base-copies to "svn" that will recursively remove
> the base copies from the current directory down.

Ideally that command would watch out for files of which the base copy
probably will be needed in the future (modified files, mainly). That
could be overridden with --force.

> 5. Change the commit/merge to send the whole working copy instead
> of fetching a base copy from the server and send back the diff,
> if the .svn does not contain the base copy.

Presuming the user always used "3. prepare-edit" there should be no
need for step 5. For merge, I am not sure, but the prestine copy
probably will be needed.

Thinking about it, I got the following idea. You could get your
changes to be far less intrusive for the beginning, if you add a
command or option to fetch the prestine base copy. That would allow to
do 1. and 5. later (of course, it would make everyday work a bit
harder, but it is only intermediate) and you probably want the command
anyhow (for testing and whatever). In other words, you'd to do

  $ svn fetch-base-copy foo.c

before you can do

  $ svn diff -rHEAD foo.c

If you forgot, you would simply get an error (see "0b.").

And if you want to get further, you could even enable it to
automatically determine all base copies which are needed for certain
(due to changes, add, whatever... i.e. making the requirement to issue
prepare-edit softer).

> Does this sound like a plan? I am willing to work on it, if the
> more experienced guys think this is a way to go.
>
> Comments? Flames?

Ben, what are your thoughts on a changed plan? Has something like this
a better (well, realistic) chance to be accepted:

A. (Might exist already) Store in the .svn admin area checksums of the
   base copies.

B. Assure that all places using the prestine base copy do something
   sensible when it is missing (probably give a reasonable error) and
   make a list of them for later.

C1. Add a "--no-base-copy" option to "svn checkout".
C2. Add a "prepare-edit" command to "svn" that will copy the
    working copy into the base copy (if the checksums match).
C3. Add some fetch-base command/option (could be combined with C2).
C4. Add a cleanup-base-copies command/option.

All that is needed to have a basic version running wouldn't require
big changes to existing code, as far as I can see. Mainly some
if-condition to "svn checkout" and some updates to the error messages
(to be sure they make sense in the new context).

I hope others agree that this should be possible for 1.0. If the
fetch-bases command becomes "intelligent", it would be quite usable,
too. At least better than nothing. :-)

After that works one could determine when to change the other points:

D. Tweak libsvn_wc/diff.c:file_diff to fetch a pristine copy from the
   server if a cached base version is not available. The downloaded
   pristine copy should be cached.

E. Change the commit/merge to send the whole working copy instead
   of fetching a base copy from the server and send back the diff,
   if the .svn does not contain the base copy.

F. Whatever else needs tweaking for automagically working.

HTH,

        Benjamin.

PS: Currently, I have no interest in implementing this feature, nor
    the feature itself - I have no repositories of a size where that
    would matter. But I see why others want it and wanted to show
    Florin a possible way. At least I hope it is.

  • application/pgp-signature attachment: stored
Received on Mon Mar 24 20:08:19 2003

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.