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

Re: svn_hardlink_textbase.pl: script to consolidate disk space by hardlinking working files to their text-base

From: Lars Ellenberg <l.g.e_at_web.de>
Date: 2004-10-27 00:50:27 CEST

/ 2004-10-26 16:58:39 -0500
\ Ben Collins-Sussman:
>
> On Oct 26, 2004, at 4:21 AM, Lars Ellenberg wrote:
>
> >
> >I don't know whether this has been done elsewhere already,
> >or whether this is usefull in general at all.
> >It proved to work fine for me, though.
> >
> >It definetely works fine with svn 1.0.6 and vim 6.3.
> >
> >
>
> ...until you start doing keyword substitution or EOL conversion!

nope.
if the content is the same, it is the same.

>
> What happens when a working file and text-base are hard-linked
> together, then somebody activates keyword substitution ('svn propset
> svn:keywords') and then commits? Does the svn client happily re-create
> the working file, automatically undoing the hard link?

of course I checked with the mentioned svn client.
yes, it does.
  
  |$ ls -1i tmp.text .svn/text-base/tmp.text.svn-base
  | 265607 .svn/text-base/tmp.text.svn-base
  | 265607 tmp.text
  |$ cat tmp.text
  |$Id$
  |
  |lalala
  |lululu
  |
  |$ svn ps svn:keywords Id tmp.text
  |property 'svn:keywords' set on 'tmp.text'
  |$ cat tmp.text
  |$Id$
  |
  |lalala
  |lululu
  |
  |$ ls -li tmp.text .svn/text-base/tmp.text.svn-base
  | 265607 .svn/text-base/tmp.text.svn-base
  | 265607 tmp.text
  |$ svn ci -m "set svn:keywords Id"
  |Sending mytry/tmp.text
  |
  |Committed revision 2.
  |$ ls -1i tmp.text .svn/text-base/tmp.text.svn-base
  | 265607 .svn/text-base/tmp.text.svn-base
  | 265622 tmp.text
  |$ cat tmp.text
  |$Id: tmp.text 2 2004-10-26 22:39:49Z lars $
  |
  |lalala
  |lululu
  |
  |$ perl ~/bin/svn_hardlink_text_base.pl
  |...
  |hardlinked 0 of 1 files, (0 bytes)
  |# because now obviously the content is no longer the same.

I _don't_ suggest that this is functionality to be included in svn.
it is certainly not, because it is not portable,
and it may contradict what people may expect.

but if you know what you are doing (you explicitly use this hardlink script, so you should),
it can consolidate lots of megabytes. and since this script makes this very easy,
I thought I'd share.

of course, if you have a valid reason not to use it, tell me.
I for sure do not want to screw up my WDs, or even repositories.

thanks,

        lge

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 27 01:10:29 2004

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