[jira] [Commented] (SVN-3679) Perl API SVN::Ra get_commit_editor* functions broken, missing, untested
"Markus Kuhn (Jira)" <[email protected]> Mon, 9 Mar 2026 18:57:00 +0000 (UTC)
| Newsgroups | gmane.comp.version-control.subversion.issues |
|---|---|
| Message-ID | <[email protected]> |
[ https://issues.apache.org/jira/browse/SVN-3679?page=3Dcom.atlassian.j=
ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D180642=
24#comment-18064224 ]=20
Markus Kuhn commented on SVN-3679:
----------------------------------
I've asked Claude Sonnet 4.6 to compare what Ra.pm claims against what 6ra.=
t tests, and it suggested a few more improvements to align the get_commit_e=
ditor\{,2,3} tests and the claims in the documentation. It proposed the att=
ached changes:
Ra.pm fixes:
* Added =3Ditem $ra->get_commit_editor3($revprop_table, ...) =E2=80=94 it =
was tested but entirely undocumented
* Reordered: get_commit_editor callback's 3-arg description now comes befo=
re the get_commit_editor2/3 callback description (was backwards)
* Fixed typo: "I seems that" =E2=86=92 the paragraph was rewritten and the=
typo eliminated
* Clarified $logmsg vs $revprop_table: notes that get_commit_editor/2 take=
a string, while get_commit_editor3 takes a hashref
* Simplified the outdated $lock_tokens paragraph (removed Subversion 1.2/1=
.3.1 historical notes)
6ra.t fixes: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
* Added 2 new tests for the get_commit_editor callback's $committed_date (=
format check) and $committed_author (defined check) =E2=80=94 these values =
were captured but never asserted, unlike the equivalent get_commit_editor2 =
tests
* Updated test count from 57 =E2=86=92 59
Extended patches (include the previous ones): [^6ra.t.diff] [^Ra.pm.diff]
> Perl API SVN::Ra get_commit_editor* functions broken, missing, untested
> -----------------------------------------------------------------------
>
> Key: SVN-3679
> URL: https://issues.apache.org/jira/browse/SVN-3679
> Project: Subversion
> Issue Type: Bug
> Components: bindings_swig_perl, docs
> Affects Versions: 1.6.x
> Reporter: Markus Kuhn
> Priority: Minor
> Fix For: unscheduled
>
> Attachments: 6ra.t-1.diff, 6ra.t.diff, Ra.pm-1.diff, Ra.pm.diff
>
>
> {noformat:nopanel=3Dtrue}
> The test cases for the Perl API SVN::Ra at
> bindings/swig/perl/native/t/6ra.t
> currently (as of 1.6.12) lack tests for functions needed to commit a chan=
ge to
> the repository via the remote-access API layer. For starters, there are n=
o tests
> for get_commit_editor, get_commit_editor2, get_commit_editor3. (The SVN::=
Ra man
> page even says that the author did not succeed in testing get_commit_edit=
or,
> get_commit_editor2; get_commit_editor3 is not even listed.)
> When I try to use e.g. get_commit_editor2 as suggested in the SVN::Ra
> man page, I just get an error message like
> TypeError in method 'svn_ra_get_commit_editor2', argument 5 of type
> 'svn_commit_callback2_t'
> A short example Perl script that reproduces this is attached below.
> Motivation: The remote-access layer API is very useful for applications (=
such as
> Web CGI editors) that want to commit changes without the overhead and dis=
k-state
> involved with having to checkout a working directory first. Perl remains =
a
> popular CGI scripting language, which makes a well-tested, production-qua=
lity
> Perl SWIG binding for svn_ra.h highly desirable.
> See also:
> http://mail-archives.apache.org/mod_mbox/subversion-users/201007.mbox/bro=
wser
> http://svn.haxx.se/dev/archive-2010-07/0272.shtml
> How to reproduce TypeError:
> #!/usr/bin/perl
> use SVN::Core;
> use SVN::Ra;
> use SVN::Delta;
> my $ra =3D SVN::Ra->new('http://svn.apache.org/repos/asf/subversion/');
> my $path =3D 'trunk/BUGS';
> open($fh, '>', \$text) || die;
> my ($revnum, $props) =3D $ra->get_file($path, $SVN::Core::INVALID_REVNUM,=
$fh);
> close $fh || die;
> print "Revision: $revnum\n\n$text\n";
> my $logmsg =3D "test commit via the SVN:Ra Perl API";
> sub commit_callback {
> my ($arg) =3D @_;
> use Data::Dumper;
> print STDERR "commit_callback(".Dumper($arg).")\n";
> }
> my $editor =3D SVN::Delta::Editor->new(
> $ra->get_commit_editor2($logmsg, \&commit_callback, undef, {}, 0));
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)