zigdon has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SVN::Client not committing?
by Sandy (Curate) on Nov 29, 2006 at 20:43 UTC | |
by zigdon (Deacon) on Nov 29, 2006 at 21:38 UTC | |
by duncs (Beadle) on Jun 10, 2008 at 13:50 UTC | |
by Avi (Acolyte) on Feb 03, 2010 at 07:18 UTC | |
by svenXY (Deacon) on Jan 19, 2011 at 11:59 UTC | |
by zigdon (Deacon) on Jun 18, 2008 at 22:39 UTC | |
|
Re: SVN::Client not committing?
by Anonymous Monk on Nov 30, 2006 at 11:18 UTC | |
|
Re: SVN::Client not committing?
by Anonymous Monk on Jun 15, 2012 at 17:06 UTC |