I am trying to write a function for commit with logmesg using the Alien SVN::Client perl API. I am struct with the array of object function
For Your Reference
$ctx->log_msg(\&log_msg) Sets the log_msg callback for the client context to a code reference that you pass. It always returns the current codereference set. The subroutine pointed to by this coderef will be called to get the log message for any operation that will commit a revision to the repo. It receives 4 parameters. The first parameter is a reference to a scalar value in which the callback should place the log_msg. If you wish to cancel the commit you can set this scalar to undef. The 2nd value is a path to a temporary file which might be holding that log message, or undef if no such field exists (though, if log_msg is undef, this value is undefined). The log message MUST be a UTF8 string with LF line separators. The 3rd parameter is a reference to an array of svn_client_commit_item3_t objects, which may be fully or only partially filled-in, depending on the type of commit operation. The 4th and last parameter will be a pool. If the function wishes to return an error it should return a svn_error_t object made with SVN::Error::create. Any other return value will be interpreted as SVN_NO_ERROR.
my $ctx= new SVN::Client(); $ctx->log_msg(\&log_msg); print "enterpath \n "; my $path = <>; chomp($path); $ctx->commit($path,0); sub log_msg { my ($logmsg,$messgpath,$citems,$pool)=@_; ($fh, $filename) = tempfile() or die "Error creating $filename: $! +"; $fh= new IO::File "+>> $filename " or die " could not open a file :$!" +; #if (defined $fh){ #my $line =<STDIN>; #print $fh $line; #} $logmsg =\$fh; $messgpath =$filename; $citems= \@svn_client_commit_item3_t; ## i am struck here }
can some body help me in writing the svn_client_commit_item3_t array of object function i tried a lot i am unable to understand what the function should return or what it should take , how to write. can some body help me with this code
In reply to help in writing Array of object by naresh777
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |