Need help on libsvn-ruby

Hi,

We want to do checkout, checkin/commit on the SVN server.
We are using libsvn-ruby gem for the same.

We could checkout through the code, but facing issues while committing
the
changes. It doesn’t show any error, but the changes are not reflected.

our code is as follows:

#!/usr/bin/env ruby

Required packages

require “svn/core”
require “svn/ext/core”
require “svn/client”
require “svn/wc”
require “svn/repos”
require ‘fileutils’

config_username = ‘sneha’
config_password = ‘seema’
config_repository_url = ‘/home/vmware/MyData’
config_output_path =‘svn://10.99.129.192/var/lib/svn/Testproj’
svn_client_commit_info_t =""
pool =""

config_revision = 10

ctx = Svn::Client::Context.new()
ctx.add_simple_provider
ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_USERNAME] = config_username
ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_PASSWORD] = config_password

begin
ctx.commit(config_repository_url, config_output_path,
config_revision.to_i, nil)
puts “before commit”

  rescue Svn::Error::CLIENT_UNRELATED_RESOURCES => e # revision

doesn’t exist
raise "no such revision " + revision.to_s + " at " + repos_uri
end


Is our code correct? or Any setting needs to be done before committing
the changes?

Also I could not find the documentation for the libsvn gem.

Hi,

In [email protected]
“need help on libsvn-ruby” on Tue, 11 Feb 2014 10:27:16 +0100,
“Shubhada S.” [email protected] wrote:

We want to do checkout, checkin/commit on the SVN server.
We are using libsvn-ruby gem for the same.

What is “libsvn-ruby gem”? Does it means Ruby bindings
bundled with the Subversion package? Or
http://rubygems.org/gems/svn gem?

If it is the former, I may help you.

require “svn/core”
svn_client_commit_info_t =""
ctx.commit(config_repository_url, config_output_path,
config_revision.to_i, nil)

What about the following code?

ctx.commit(config_repository_uri)

#commit is signature is the following:

def commit(targets, recurse=true, keep_locks=false,
keep_changelist=false, changelist_name=nil,
revprop_table=nil)

https://svn.apache.org/repos/asf/subversion/trunk/subversion/bindings/swig/ruby/svn/client.rb

config_output_path is strange.

the changes?
Also I could not find the documentation for the libsvn gem.

Tests for Svn::Client::Context may help you:
https://svn.apache.org/repos/asf/subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb

Thanks,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs