Dear monks, I come seeking your wisdom!

I must be doing something wrong here - but I can't seem to get SVN::Client to commit. Here's a little test program that shows the issue - all it tries to do is to create a new directory on a local working copy, then commit it to the repository:

#!/usr/bin/perl -w use strict; use warnings; use SVN::Client; use Term::ReadLine; use Data::Dumper; my $term = new Term::ReadLine 'MQ Package'; my $path = "/home/boger_d/lib/tmp/svn/repo"; my $svn = SVN::Client->new( auth => [SVN::Client::get_simple_provider(), # set the callback to get the username/password, if needed SVN::Client::get_simple_prompt_provider(\&prompt, 2), SVN::Client::get_username_provider() ]); # log message callback $svn->log_msg(sub {$$_[0] = "testing mkdir"}); # check the current layout print "Before mkdir:\n"; print join "\n", keys %{$svn->ls("$path", "HEAD", 0)}; # create a new directory $svn->mkdir("$path/mkdir"); # and commit it my $res = $svn->commit(["$path/mkdir"], 1); # check new layout print "\n\nAfter mkdir:\n"; print join "\n", keys %{$svn->ls("$path", "HEAD", 0)}; # and the return value of the commit print "\n\nReturn value of commit\n", Dumper $res; sub prompt { my $cred = shift; my $realm = shift; my $default_username = shift; my $may_save = shift; my $pool = shift; print "Enter authentication info for realm: $realm\n"; my $username = $term->readline("Username: "); chomp $username; $cred->username($username); my $password = $term->readline("Password: "); chomp $password; $cred->password($password); }

Seems simple enough, but when it runs, here's what I get:

Before mkdir: mq_check After mkdir: mq_check Return value of commit $VAR1 = undef;

The docs aren't great (and missing from CPAN for some reason - here's a copy), but I believe I'm using the module correctly.

Anyone have any experience with this? Any idea what I might be doing wrong? I can tell it's connecting to the repo ok, since it can list the contents correctly. I can also see it did actually create the new directory, and scheduled it for adding - just not able to commit!

Any help would be greatly appreciated!

-- zigdon


In reply to SVN::Client not committing? by zigdon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.