Just for interest, the cases where the node paths are printed wrongly:
Paths are actually wrong for *all* of repos-wc, repos-repos and wc-wc, other
than previously assumed.
~Neels
===== repos-wc =====
svn diff --summarize \
--old=file:////arch/hg/svn-tc/test/repos/foo/modified_file \
--new=quux/modified_file
M file:///[...]/repos/foo/modified_file/quux/modified_file
===== repos-repos =====
svn diff --summarize \
--old=file:////arch/hg/svn-tc/test/repos/foo/modified_file_at_2 \
--new=file:////arch/hg/svn-tc/test/repos/quux/modified_file_at_3
M file:///[...]/repos/foo/modified_file/modified_file
===== wc-wc =====
svn diff --summarize --old=quux/modified_file --new=quux/modified_file
M quux/modified_file/quux/modified_file
--
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696 mobile: +49 177 2345869 fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
#!/bin/sh
# The next line is the only line you should need to adjust.
SVNDIR=/arch/elego/svn/trunk
## GENERIC PREPARATIONS
SVN=${SVNDIR}/subversion/svn/svn
SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin
# use my local way if my script is there (neels).
if [ -f /usr/local/bin/superpower ]; then
echo "##### REMEMBER TO SETUP YOUR ENVIRONMENT #####"
SVN=svn
SVNSERVE=svnserve
SVNADMIN=svnadmin
fi
${SVN} --version
# Select an access method. If svn://, the svnserve setup is
# handled automagically by this script; but if http://, then
# you'll have to configure it yourself first.
#
# URL=http://localhost/neels/repos
# URL=svn://localhost/repos
URL=file:///`pwd`/repos
rm -rf repos wc
${SVNADMIN} create repos
# These are for svnserve only.
echo "[general]" > repos/conf/svnserve.conf
echo "anon-access = write" >> repos/conf/svnserve.conf
echo "auth-access = write" >> repos/conf/svnserve.conf
# The server will only be contacted if $URL is svn://foo, of course.
${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
# And put the kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k
${SVN} co -q ${URL} wc
cd wc
## ACTUAL TEST
create_stuff()
{
if [ -n "$1" -a ! -e "$1" ]
then
mkdir $1
echo "modified_file" > $1/modified_file
echo "modified_file_with_props" > $1/modified_file_with_props
echo "modified_file_only_props" > $1/modified_file_only_props
mkdir $1/modified_dir
echo "file" > $1/modified_dir/file_in_modified_dir
mkdir $1/modified_dir_with_props
echo "file" > $1/modified_dir_with_props/file_in_modified_dir_with_props
mkdir $1/modified_dir_only_props
echo "file" > $1/modified_dir_only_props/file_in_modified_dir_only_props
mkdir $1/modified_empty_dir_only_props
echo "file" > $1/deleted_file
mkdir $1/deleted_dir
echo "file" > $1/deleted_dir/file_in_deleted_dir
mkdir $1/deleted_empty_dir
${SVN} add $1
else
echo "create_stuff needs a nonexistent directory argument"
fi
}
modify_stuff()
{
if [ -d "$1" ]
then
echo "more" >> $1/modified_file
echo "more" >> $1/modified_file_with_props
${SVN} propset changedprop propchange $1/modified_file_with_props
${SVN} propset changedprop propchange $1/modified_file_only_props
echo "added file" > $1/added_file
${SVN} add $1/added_file
echo "added file with props" > $1/added_file_with_props
${SVN} add $1/added_file_with_props
${SVN} propset addedprop propadd $1/added_file_with_props
echo "more" >> $1/modified_dir/file_in_modified_dir
${SVN} propset changedprop propchange $1/modified_dir_with_props
echo "more" >> $1/modified_dir_with_props/file_in_modified_dir_with_props
${SVN} propset changedprop propchange $1/modified_dir_only_props
${SVN} propset changedprop propchange $1/modified_empty_dir_only_props
mkdir $1/added_dir
echo "newfile" > $1/added_dir/file_in_added_dir
${SVN} add $1/added_dir
mkdir $1/added_dir_with_props
echo "newfile" > $1/added_dir_with_props/file_in_added_dir_with_props
${SVN} add $1/added_dir_with_props
${SVN} propset changedprop propchange $1/added_dir_with_props
mkdir $1/added_empty_dir
${SVN} add $1/added_empty_dir
mkdir $1/added_empty_dir_with_props
${SVN} add $1/added_empty_dir_with_props
${SVN} propset changedprop propchange $1/added_empty_dir_with_props
${SVN} rm $1/deleted_file $1/deleted_dir $1/deleted_empty_dir
else
echo "modify_stuff needs a directory argument"
fi
}
echo "===== creating rev 1"
create_stuff foo
${SVN} ci -m "rev 1"
echo "===== creating rev 2"
modify_stuff foo
${SVN} ci -m "rev 2"
# Do the same again in a different dir, but leave mods
# uncommitted.
echo "===== creating rev 3"
create_stuff quux
${SVN} ci -m "rev 3"
echo "===== creating local changes"
modify_stuff quux
${SVN} up
# let's see what diff has to say.
echo
echo "===== Results ====="
echo "===== repos-wc ====="
echo
echo "${SVN} diff --summarize --old=${URL}/foo/modified_file --new=quux/modified_file"
${SVN} diff --summarize --old=${URL}/foo/modified_file --new=quux/modified_file
echo
echo "${SVN} diff --summarize --old=${URL}/foo/modified_file_at_1 --new=quux/modified_file"
${SVN} diff --summarize --old=${URL}/foo/modified_file_at_2 --new=quux/modified_file
echo
echo "===== repos-repos ====="
echo
echo "${SVN} diff --summarize --old=${URL}/foo/modified_file_at_2 --new=${URL}/quux/modified_file_at_3"
${SVN} diff --summarize --old=${URL}/foo/modified_file_at_2 --new=${URL}/quux/modified_file_at_3
echo
echo "===== wc-wc ====="
echo
echo "${SVN} diff --summarize --old=quux/modified_file --new=quux/modified_file"
${SVN} diff --summarize --old=quux/modified_file --new=quux/modified_file
## ACTUAL TEST ENDS
echo "====="
cd ..
./k
Received on 2008-10-16 10:49:39 CEST