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

Problems with hardlinks

From: Matthias Schniedermeyer <matthias.schniedermeyer_at_mediaways.net>
Date: 2002-10-07 15:27:09 CEST

Hi

Doing a

- cut -
cp -al <rep-dir> <rep-dir-copy> # Copy all files using hard-links
cd <rep-dir>
svn up
cd ..
diff -Nur --exclude=.svn <rep-dir-copy> <rep-dir>
- cut -

failes to see any differences. Seems linke the file(s) (is/are) overridden instead of replaced. (The "new"-file(s) (has/have) the same inode as the "old"-file(s).)
CVS does this right(tm), it creates (a) new file(s) when you update/checkout from the repository.

In my eyes this is a serious flaw.

'cp -a' without making hardlinks can take a long time and doubles the needed disk-space.
The point is that diff is intelligent enough to check if two files have the same inode and doesn't check for differences if the files have the same inode. Which can be a great speed-improvent when you
diff several MB big repositories. (And an even bigger win if the inode-cache is "hot")

e.g. There are several OSS projects i'm interested in and i check regulary what changed in their CVS-Trees.
The (complete) CVS-Tree is currently (only) 135 MB in size. (The "all time high" was at about 800MB)
- cut -
treescan anoncvs # This makes the caches "hot" (Inode/directory)
cp -al anoncvs anoncvs-old
# foreach project do an update
diff -Nur anoncvs-old anoncvs | less
- cut -

diff needs about 1-2 seconds for diffing the whole tree. Without hardlinks this takes much more time.
Even when the cache is cold before the diff, it is many times faster then without hardlinks.

The easiest(tm) fix for this would be to delete the file(s) before doing the update.
Or do it like cvs(/rsync ...) do it. Checkout into a temp-file and move that file over the old file.
(The last method is more secure. The first has a race condition.)

-- 
      Matthias Schniedermeyer                    mediaWays GmbH
         System Development                 http://www.mediaways.net
     mailto:citd@mediaways.net        voice: +49 5246 80 - 1768 fax: - 2768
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 7 16:10:28 2002

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.