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

Re: How to create a branch/tag using the SVN API?

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Wed, 28 Jul 2010 08:52:42 -0400

On 07/28/2010 04:13 AM, Jochen Hebbrecht wrote:
> Hi,
>
> I'm currently trying to create a branch/tag through the SVN API - PHP.
>
> This is my code:
>
> <?php
> // CLIENT INFO
> echo svn_client_version();
>
> // CREATING BRANCH/TAG $svn_repos = svn_repos_open("##PATH_TO_REPO##");
> $svn_fs = svn_repos_fs($svn_repos); $svn_tx = svn_fs_begin_txn2($svn_fs,
> svn_fs_youngest_rev($svn_fs)); $svn_tx_root = svn_fs_txn_root($svn_tx);
> svn_fs_copy( $svn_tx_root, "/FOO", $svn_tx_root, "/BAR");
> svn_repos_fs_commit_txn($svn_tx);
>
> ?>
>
> But then I'm getting this error:
>
> [Tue Jul 27 14:50:30 2010] [error] [client 127.0.0.1] PHP Warning:
> svn_fs_copy(): svn error(s) occured\n200007 (Trying to use an
> unsupported feature) Copy from mutable tree not currently supported\n in
> /var/www/pipa/testsvn.php on line 10
>
> Any idea's what I'm doing wrong here?

Yes, you're trying to use a mutable tree (one based on a txn_root) as the
source of a copy, which is disallowed. For the *source* root, you need to
use svn_fs_revision_root(). (Keep doing as you are above, though, for the
copy target root.)

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2010-07-28 14:54:35 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.