I have found a bug in the svncopy.pl script that fails to properly handle fully-contained externals when branching and copying from a single source. When branching from a single source, the externals are updated to directories that do not exist.

Taken from the README <http://svn.apache.org/repos/asf/subversion/trunk/contrib/client-side/svncopy/svncopy.README>, example 5 "branching properly"...

---
Using the script allows branches to be created which are really independent.

$ perl svncopy.pl --branch http://svn/repos/trunk \
            http://svn/repos/branches/3.2_bugfix

Result:

trunk/
    [ as above]
branches/
    3.2_bugfix/
        trunk/
            common/
                common1.c
                common2.c
            inc/
                common1.h
                common2.h
            proj_foo/
                foo1.c
                foo2.c
                X common    -r 4997 http://svn/repos/trunk/common
                X inc       http://svn/repos/branches/3.2_bugfix/trunk/inc
[rest of example tree omitted]
---

The current svncopy.pl script has special logic for a single source and no longer creates the branches/3.2_bugfix/trunk directory, but puts the contents directly in branches/3.2_bugfix. The logic is more along the lines of the "svn copy" command. (This was added in a patch a year ago. <http://svn.haxx.se/dev/archive-2009-06/0064.shtml>)

The problem is the fully-contained external, when updated for the branch, is still updated to what the non-patched version would have created, http://svn/repos/branches/3.2_bugfix/trunk/inc, which no longer exists.

I can try to fix it, but I have very little Perl experience, and definitely not enough to easily understand the testsvncopy.pl script to make a test case.

Here is the verbose output of a branch command up until the error first appears.

$ svncopy.pl -b --verbose https://192.168.1.197/svn/ASA/branches/release/trunk-v01_00b2/trunk https://192.168.1.197/svn/ASA/Sandbox/AF/tmp/branch_test

=================================================================
=== Copying from:
=== https://192.168.1.197/svn/ASA/branches/release/trunk-v01_00b2/trunk
===
=== Copying to:
===       https://192.168.1.197/svn/ASA/Sandbox/AF/tmp/branch_test
===
===  - branching (updating fully-contained svn:externals definitions)
===
multiple_sources: No
Using temporary directory /tmp/svncopy_S1AkIqIak9
Copying source URI to destination URI
> svn copy --file /tmp/svncopy_S1AkIqIak9/CDYv8LFfbX https://192.168.1.197/svn/ASA/branches/release/trunk-v01_00b2/trunk https://192.168.1.197/svn/ASA/Sandbox/AF/tmp/branch_test
Checking out destination directory '/tmp/svncopy_S1AkIqIak9/branch_test'
> svn co https://192.168.1.197/svn/ASA/Sandbox/AF/tmp/branch_test /tmp/svncopy_S1AkIqIak9/branch_test
Checking '/tmp/svncopy_S1AkIqIak9/branch_test'
 > svn propget -R svn:externals /tmp/svncopy_S1AkIqIak9/branch_test
- Found c-SimpleReturns => 'https://192.168.1.197/svn/ASA/branches/release/trunk-v01_00b2/trunk/projects/barring/toolkit-simple-returns/c-SimpleReturns' - updated 'c-SimpleReturns https://192.168.1.197/svn/ASA/branches/release/trunk-v01_00b2/trunk/projects/barring/toolkit-simple-returns/c-SimpleReturns' to 'c-SimpleReturns https://192.168.1.197/svn/ASA/Sandbox/AF/tmp/branch_test/trunk/projects/barring/toolkit-simple-returns/c-SimpleReturns'
[rest omitted]

Again, note that although the branch is at branch_test, the new external points to branch_test/trunk.

--
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233

Reply via email to