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

svn_load_dirs.pl and paths with '@'

From: Kevinm <kevinmusker_at_gmail.com>
Date: Mon, 20 Dec 2010 16:28:39 +0000

I stumbled across a bug in svn_load_dirs.pl when importing paths with an
ampersand character. Anything after the final ampersand in a path gets
interpreted as a peg revision during the add phase, so the affected files
don't get imported and the sanity check at the end fails.

I have attached a patch to get around the issue; it always adds
an ampersand to the end of each path while building the TARGETS file. This
is documented in the svn book here:

The perceptive reader is probably wondering at this point whether the peg
> revision syntax causes problems for working copy paths or URLs that actually
> have at signs in them. After all, how does svn know whether news_at_11 is the
> name of a directory in my tree or just a syntax for “revision 11 of news”?
> Thankfully, while svn will always assume the latter, there is a trivial
> workaround. You need only append an at sign to the end of the path, such as
> news_at_11@. svn cares only about the last at sign in the argument, and it is
> not considered illegal to omit a literal peg revision specifier after that
> at sign. This workaround even applies to paths that end in an at sign—you
> would use filename@@ to talk about a file named filename@.

Below is a simple test to reproduce the issue:

dev-kevinm04:~$ mkdir test
dev-kevinm04:~$ touch test/a.txt
dev-kevinm04:~$ svnadmin create repos
dev-kevinm04:~$ svn_load_dirs -v -t 1.0 file://`pwd`/repos current test
Directory test will be tagged as 1.0


Cleaning up /tmp/svn_load_dirs_a_cRabZpNS
dev-kevinm04:~$ touch test/b_at_c.txt
dev-kevinm04:~$ svn_load_dirs -v -t 2.0 file://`pwd`/repos current test
Directory test will be tagged as 2.0


Checking out file:///home/london/kevinm/repos/current into
Running /usr/local/bin/svn checkout --non-interactive
file:///home/london/kevinm/repos/current my_import_wc

Loading test and will save in tag 2.0.
A b_at_c.txt
Running /usr/local/bin/svn add -N --targets
Running /usr/local/bin/svn commit --non-interactive -m Load test into

Running /usr/local/bin/svn update --non-interactive
Running /usr/local/bin/svn cp --non-interactive -m Tag current as 2.0.
Checking out file:///home/london/kevinm/repos/2.0 into
Running /usr/local/bin/svn checkout --non-interactive
file:///home/london/kevinm/repos/2.0 my_tag_wc_named_2.0
Running diff -u -x .svn -r test
/usr/local/bin/svn_load_dirs: diff -u -x .svn -r test
/tmp/svn_load_dirs_SfwwQDtsAX/my_tag_wc_named_2.0 failed with this output:
Only in test: b_at_c.txt
Press return to quit and clean up svn working directory:
Cleaning up /tmp/svn_load_dirs_SfwwQDtsAX


Received on 2010-12-20 17:47:17 CET

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.