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

Re: Subversion and hard links

From: Mark Reibert <svn_at_reibert.com>
Date: 2007-10-24 07:15:05 CEST

On Tue, 2007-10-23 at 22:15 -0500, Troy Curtis Jr wrote:
> Just curious if anyone knows whether Subversion is "compatible" with
> hard links on a linux box? What I mean is if I copy a directory using
> hard links instead of an actual copy, will subsequent updates, merges,
> etc "break" the hard-links correctly such that the directories will
> begin to diverge?

I just performed a simple test, and yes - at least for "svn up" - the
hard link is "broken". This tells me "svn up" is unlink(2)'ing the file
before writing the new one. I did not test other actions (e.g., merge)
that would alter the working copy.

Log from script session attached.

-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------

Script started on Tue 23 Oct 2007 10:06:24 PM MST
[mark_at_hellcat tmp]$ svn co svn://scmsrv/tmp wc-1
A wc-1/directory
A wc-1/directory/hello.txt
A wc-1/target
A wc-1/WinXPSP2_Documentation.doc
A wc-1/link
Checked out revision 23.
[mark_at_hellcat tmp]$ svn co svn://scmsrv/tmp wc-other
A wc-other/directory
A wc-other/directory/hello.txt
A wc-other/target
A wc-other/WinXPSP2_Documentation.doc
A wc-other/link
Checked out revision 23.
[mark@hellcat tmp]$ cp -al wc-1 wc-2
[mark@hellcat tmp]$ ls -al wc*/target
-rw-r--r-- 2 mark users 14 Oct 23 22:06 wc-1/target
-rw-r--r-- 2 mark users 14 Oct 23 22:06 wc-2/target
-rw-r--r-- 1 mark users 14 Oct 23 22:06 wc-other/target
[mark@hellcat tmp]$ cat wc-1/target
a link target
[mark@hellcat tmp]$ echo "just a link target" > wc-other/target
[mark@hellcat tmp]$ svn ci -m '' wc-other
Sending wc-other/target
Transmitting file data .
Committed revision 24.
[mark@hellcat tmp]$ svn up wc-2
U wc-2/target
Updated to revision 24.
[mark@hellcat tmp]$ ls -al wc*/target
-rw-r--r-- 1 mark users 14 Oct 23 22:06 wc-1/target
-rw-r--r-- 1 mark users 19 Oct 23 22:08 wc-2/target
-rw-r--r-- 1 mark users 19 Oct 23 22:07 wc-other/target
[mark@hellcat tmp]$ cat wc-1/target
a link target
[mark@hellcat tmp]$ cat wc-2/target
just a link target
[mark@hellcat tmp]$
Script done on Tue 23 Oct 2007 10:08:47 PM MST

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 24 07:15:28 2007

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

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