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

Paths, base revision and symlinks

From: Vincent Lefevre <vincent-svn_at_vinc17.net>
Date: Thu, 21 Jun 2012 15:02:55 +0200

The svn behavior has changed with Subversion 1.7 (or at least 1.7.5)
concernant the interpretation of paths. If might be seen as a fix to
follow the description of peg revisions, and in particular the notion
of default peg revision, which is "BASE". But this is still poorly
specified.

For instance, how is path/to/file resolved? And path/to/file_at_rev,
where rev is a numeric value, BASE or HEAD?

The Subversion book just says: "Locate item in the revision identified
by PEG-REV [or OPERATIVE-REV]."

But how is the item identified, e.g. when symlinks are involved? And
what is the BASE revision (when this is the implied reg revision) in
a mixed-revision working copy? The specification should cover every
case of the example given below.

With usual commands, a path is resolved according to the local system
rules (under GNU/Linux, given by the path_resolution(7) man page).
But svn doesn't behave that way, and I think this is bad when a peg
revision isn't provided (i.e. when one just has a standard path).

This could seem a bit particular and complex, but after an upgrade
from 1.6.17 to 1.7.5, there is an annoying practical consequence:
symbolic links (whether they are versioned or not) to directories
in the working copy (except the root) are no longer followed.

Here's an example with various tests:

------------------------------------------------------------
#!/bin/sh

set -x

mkdir my-test-svn || exit
cd my-test-svn

svnadmin create svn
svn co file://`pwd`/svn wc
cd wc

mkdir -p dir1 dir2/dir2b
echo data1 > dir1/file
echo data2 > dir2/dir2b/file
svn add dir1 dir2
svn ci -m 'dir1 and dir2'

svn rm dir2/dir2b
ln -s ../dir1 dir2/dir2b
cat dir1/file
svn cat dir1/file
cat dir2/dir2b/file
svn cat dir2/dir2b/file

rm dir2/dir2b
svn ci dir2 -m 'dir2 update'
ln -s ../dir1 dir2/dir2b
cat dir2/dir2b/file
svn cat dir2/dir2b/file

echo new > dir1/file
svn ci dir1 -m 'new dir1/file'

cat dir1/file
svn cat dir1/file
cat dir2/dir2b/file
svn cat dir2/dir2b/file

for i in . dir1 dir2 dir1/file; do svn ls -v $i; done

ln -s dir1/file foo-rel
cat foo-rel
svn info foo-rel

ln -s `pwd`/dir1/file foo-abs
cat foo-abs
svn info foo-abs

ln -s `pwd` bar
svn info bar
svn cat bar/dir1/file

ls -l
------------------------------------------------------------

I've attached the output.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Received on 2012-06-21 15:03:30 CEST

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.