You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Anton Yuzhaninov <ci...@citrin.ru> on 2014/01/31 17:09:54 UTC

perl API: Assertion failed: (svn_dirent_is_canonical(dirent, pool)), function svn_dirent_dirname, file subversion/libsvn_subr/dirent_uri.c, line 1200

After upgrade to subversion 1.8.5 my perl script no longer works:

Assertion failed: (svn_dirent_is_canonical(dirent, pool)), function 
svn_dirent_dirname, file subversion/libsvn_subr/dirent_uri.c, line 1200.
Abort (core dumped)

Simple test case:

use SVN::Client;

my $client = new SVN::Client();

my $file = './infra/named.conf.templ';

$client->diff(
         [], # diff_options
         # $target1, $revision1, $target2, $revision2,
         $file, 'BASE', $file, 'WORKING',
         0,  # recursive
         1,  # ignore_ancestry
         1,  # no_diff_deleted
         \*STDOUT,    # outfile
         \*STDERR,   # errfile,
);

If $file contains absolute file path, than this script works, but I want to use 
relative file path.

If file name should be in some "canonical" form, this canonization IMHO should 
be done inside SVN::Client.

Version info:

FreeBSD 8.4-STABLE amd64

svn, version 1.8.5 (r1542147)
    compiled Nov 29 2013, 10:47:43 on amd64-portbld-freebsd8.4
(installed from ports, perl API installed from ports too).

perl 5.16.3 with ithreads

Re: perl API: Assertion failed: (svn_dirent_is_canonical(dirent, pool)), function svn_dirent_dirname, file subversion/libsvn_subr/dirent_uri.c, line 1200

Posted by Ben Reser <be...@reser.org>.
On 2/4/14, 3:48 AM, Anton Yuzhaninov wrote:
> Thanks. IMHO this sample should be added to SVN::Client documentation. It is
> not obvious moment.

Done in r1566230.



Re: perl API: Assertion failed: (svn_dirent_is_canonical(dirent, pool)), function svn_dirent_dirname, file subversion/libsvn_subr/dirent_uri.c, line 1200

Posted by Anton Yuzhaninov <ci...@citrin.ru>.
On 01/31/14 21:07, Ben Reser wrote:
> In the meantime you can do the following to do the canonicalization:
> if (SVN::Core::path_is_url($file)) {
>    $file = SVN::Core::uri_canonicalize($file);
> } else {
>    $file = SVN::Core::dirent_canonicalize($file);
> }

Thanks. IMHO this sample should be added to SVN::Client documentation. It is not 
obvious moment.

Re: perl API: Assertion failed: (svn_dirent_is_canonical(dirent, pool)), function svn_dirent_dirname, file subversion/libsvn_subr/dirent_uri.c, line 1200

Posted by Ben Reser <be...@reser.org>.
On 1/31/14, 8:09 AM, Anton Yuzhaninov wrote:
> my $file = './infra/named.conf.templ';
>
> If $file contains absolute file path, than this script works, but I want to use
> relative file path.

Well in the example you can solve the problem by just removing the leading './'.

> If file name should be in some "canonical" form, this canonization IMHO should
> be done inside SVN::Client.

I agree with you.  However, none of the SWIG bindings do this for you at
current.  Not sure though if we can really change this.  We'd need to think
through if there are any compatibility issues since there are a lot of tools
using the bindings already.

In the meantime you can do the following to do the canonicalization:
if (SVN::Core::path_is_url($file)) {
  $file = SVN::Core::uri_canonicalize($file);
} else {
  $file = SVN::Core::dirent_canonicalize($file);
}