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

svn_ra_do_update2 sends copyfrom_path though start_empty=TRUE in report

From: Dmitry Pavlenko <pavlenko_at_tmatesoft.com>
Date: Thu, 2 Aug 2012 20:04:50 +0200

Hello,
I think, I've found bug in Subversion API (though I doubt that CLI is affected).
Checked with 1.6.12 and r1361615 (trunk ~1.8.0-dev).

I run "update" request on some repository:

svn_ra_do_update2(session, &update_reporter, &reporter_baton, 50, "",
        svn_depth_infinity, TRUE, editor, NULL, pool);
update_reporter->set_path(reporter_baton, "", 50, svn_depth_infinity, TRUE, NULL, pool);
update_reporter->finish_report(reporter_baton, pool);

Please, pay attention to send_copyfrom_args=TRUE argument of "svn_ra_do_update2"
and to start_empty=TRUE argument of "set_path".

As I understand, by telling start_empty=TRUE I say to the remote part (server) that I have
no files in path "", and revision, specified to "set_path" is ignored. So I expect that
Subversion won't send me "copyfrom_path" in "add_file" editor call.

But it does, and this is a bug to my opinion.

Even though send_copyfrom_args=TRUE the documentation says
"ask the server to send copyfrom arguments to add_file() and add_directory() when *possible*"

I've implemented "add_file" in this way:

static svn_error_t *
add_file(const char *path,
         void *parent_baton,
         const char *copyfrom_path,
         svn_revnum_t copyfrom_revision,
         apr_pool_t *pool,
         void **file_baton) {
if (copyfrom_path)
    fprintf(stderr, "entered file \t\t\t%s\t\t\t%s\t%d\n", path, copyfrom_path, copyfrom_revision);
    return SVN_NO_ERROR;
}

and get the following output (Subversion proposes me to get the files from the revisions I definitely do not have).

$ gcc update_test.c -I/usr/include/subversion-1 -I/usr/include/apr-1.0 -lsvn_ra-1 -lsvn_client-1 -o update_test
$ ./update_test
entered file trunk/tabbed /trunk/tabbed.py 25
entered file trunk/LICENSE /trunk/README 1
entered file trunk/README.rst /trunk/README.mkd 27

I've attached full source of the minimal code to reproduce and a repository on which the bug is reproducible.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git+svn on the server side


Received on 2012-08-02 20:06:47 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.