Just another perl hacker somewhere near Disneyland
I have this homenode [perlmonks.org] of little consequence on Perl Monks [perlmonks.org] that you probably have no interest in whatsoever.
I also have some modules [cpan.org] on CPAN [cpan.org] some of which are marginally [cpan.org] more [cpan.org] useful [cpan.org] than others.
# Create project branch
$ctx->copy( $trunk, 'HEAD', $project_url );
# Switch working directory to project
$ctx->switch( $wrk_dir, $project_url, 'HEAD', 1 );
# Tag this revision as revision zero
my $rev = "$tags/${project}R0";
$ctx->copy( $project_url, 'HEAD', $rev );
I know tagging every revision may be overkill, but it makes me more comfortable. One part I wasn't too sure of was how to tell if a $project_url already existed, I searched but could not find a definitive answer. At first I did a $ctx->ls(...) but that's not very efficient if a URL has lots of files (which these directories do), so I settled on:
my $exists = eval { $ctx->proplist( $project_url, 'HEAD', 0 ) };
If anyone has a better answer, I'm all ears
my $url = eval { $ctx->url_from_path( $wrk_dir ) };
The above code works fine, except on Windows, where the program blows up (even with the eval) if the working directory is, e.g. (by mistake), "C:/" (a top-level directory) with:
Assertion failed: is_canonical (base, blen), file C:\Home\brane\src\svn\releases
\subversion-1.2.3\subversion\libsvn_subr\path.c, line 114
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
...which is seems to be a subversion library error? I don't see this particular problem reported anywhere yet...
Perling in svn 0 Comments More | Login | Reply /