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

Re: Creating directory copy operations in a dump stream

From: Eric S. Raymond <esr_at_thyrsus.com>
Date: Fri, 11 Oct 2019 06:19:41 -0400

Johan Corveleyn <jcorvel_at_gmail.com>:
> - Just guessing here, but perhaps the problem with your test is that
> your working copy is "mixed-revision" after you added the three files.
> I.e. the 'trunk' directory is a revision behind, after you added the
> three files. See if it makes a difference if you do "svn up $wc_root"
> before performing the "svn copy trunk branches/stable".

That did the trick, thanks.

For your entertainment, here's how the test koad generator now looks:

----------------------------------------------------------------------------
## General test load for ancestry-chasing logic

dump=no
verbose=null
while getopts dv opt
do
    case $opt in
        d) dump=yes;;
        v) verbose=stdout;;
    esac
done

trap 'rm -fr test-repo test-checkout' 0 1 2 15

svnaction () {
    filename=$1
    content=$2
    comment=$3
    if [ ! -f $filename ]
    then
        if [ ! -d `dirname $filename` ]
        then
            mkdir `dirname $filename`
            svn add `dirname $filename`
        fi
        echo "$content" >$filename
        svn add $filename
    else
        echo "$content" >$filename
    fi
    svn commit -m "$comment" $filename
}

{
set -e
make svn-branchy
cd test-checkout
# Content operations start here
svnaction "trunk/foo.txt" "Now is the time." "More example content"
svnaction "trunk/bar.txt" "For all good men." "Example content in different file"
svnaction "trunk/baz.txt" "to come to the aid of their country." "And in yet another file"
svn up # Without this, the next copy does file copies. With it, a directory copy.
svn copy trunk branches/stable
svn commit -m "First directory copy"
svnaction "trunk/foo.txt" "Whether tis nobler in the mind." "Hamlet the Dane said this"
svnaction "trunk/bar.txt" "or to take arms against a sea of troubles" "He continued"
svnaction "trunk/baz.txt" "and by opposing end them" "The build-up"
svnaction "trunk/foo.txt" "to be," "Famous soliloquy begins"
svnaction "branches/foo.txt" "or not to be." "And continues"
svn up
svn copy trunk tags/1.0
svn commit -m "First tag copy"
# We're done
cd ..
} >/dev/$verbose 2>&1
if [ "$dump" = yes ]
then
    svnadmin dump -q test-repo
fi
----------------------------------------------------------------------------

This will get longer and include the most perverse combinations of
deletes and copies I can dream up. The point, of course, is to
torture-test my Subversion dump analyzer.

I have a fairly nice gallmaufry of static stream dumps I've gathered
or made by hand over the years; being able to generate them easily
will be helpful.

-- 
		Eric S. Raymond
Received on 2019-10-11 12:26:00 CEST

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.