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

Re: [PATCH] make symlinked hook-scripts work again

From: Josef Wolf <jw_at_raven.inka.de>
Date: 2003-01-09 23:49:55 CET

On Thu, Jan 09, 2003 at 04:58:11PM +0000, Philip Martin wrote:

[ ... ]
> > Does everybody agree that this should be bombed out?
> That should not commit. When I try it, it does not commit
[ ... ]
> Is your patch responsible for allowing that to commit?

I don't think so. I have double-checked now: the patched version
behaves _exactly_[1] the same as the original version at those test
cases. Please note that I made "(cd wc; ln -s foo bar)" while you
typed "ln -s wc/foo wc/bar". See the difference? It appears that
this are actually two different testcases! Both, the original and
the patched version, will happily commit when the symlink-target
have no path-components.

[1] some line numbers in the error messages and names for temporary
    files are different, of course...

> Whether it's
> your patch or not, relying on an apr_file_copy error is not very good,
> Subversion should detect the problem earlier.

You're right. But doing two^Wthree steps at the same time is often
the cause of falldowns. I think the three topics we are discussing
now (symlink-hooks, symlink-target-with-no-path-components and
misleading-error-message-on-symlink-commit) are pretty much
independent things and should therefore be three different commits.

BTW: While fiddling with those testcases, I noticed that
"svn ci -m message wc" behave somewhat strange. Is this by accident or
is it by intention?

Here come the test cases I have tried so far. Please make sure you run
them _exactly_ as they are if you want reliable comparisons.

#! /bin/sh -x

cd ~/local || exit
mkdir t
cd t || exit

echo case 1
# aborts with "unsupported feature" -- seems to be OK
rm -rf test/ wc
svnadmin create test
svn co file:///`pwd`/test wc
touch wc/foo
ln -s wc/foo wc/bar
svn add wc/bar

echo case 2
# aborts with "file not found" in svn_io_copy_file()
rm -rf test/ wc
svnadmin create test
svn co file:///`pwd`/test wc
touch wc/foo wc/bar
svn add wc/bar
rm wc/bar
ln -s wc/foo wc/bar
svn ci wc

echo case 3
# succeeds!
rm -rf test/ wc
svnadmin create test
svn co file:///`pwd`/test wc
touch wc/foo wc/bar
svn add wc/bar
rm wc/bar
(cd wc; ln -s foo bar)
svn ci wc

echo case 4
# aborts with "file not found" in svn_io_copy_file()
rm -rf test/ wc
svnadmin create test
svn co file:///`pwd`/test wc
touch wc/foo wc/bar
svn add wc/bar
rm wc/bar
ln -s wc/foo wc/bar
(cd wc; svn ci -m xx)

echo case 5
# aborts with "file not found" in svn_io_copy_file()
rm -rf test/ wc
svnadmin create test
svn co file:///`pwd`/test wc
touch wc/foo wc/bar
(cd wc; svn add bar)
rm wc/bar
ln -s wc/foo wc/bar
(cd wc; svn ci -m xx)

echo case 6
# succeeds!
rm -rf test/ wc
svnadmin create test
svn co file:///`pwd`/test wc
touch wc/foo wc/bar
(cd wc; svn add bar
 rm bar
 ln -s foo bar
 svn ci -m xx
)

echo case 7
# aborts with "file not found" in svn_io_copy_file()
rm -rf test/ wc
svnadmin create test
svn co file:///`pwd`/test wc
touch wc/foo wc/bar
(cd wc; svn add bar)
rm wc/bar
ln -s wc/foo wc/bar
(cd wc; svn ci -m xx)

cd ..; rm -rf t

-- 
-- Josef Wolf -- jw@raven.inka.de --
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jan 9 23:50:16 2003

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