Forum: Ruby Ruby subversion bindings

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pieter E. (Guest)
on 2006-04-20 01:10
(Received via mailing list)
Dear all,

I'm trying to run one of the examples included with the Ruby Subversion
bindings:

$ svnlook.rb repos tree
/usr/lib/ruby/site_ruby/1.8/svn/util.rb:58:in `svn_repos_fs_wrapper':
uninitialized constant Svn::Client (NameError)
         from /usr/lib/ruby/site_ruby/1.8/svn/util.rb:58:in `fs_wrapper'
         from /usr/lib/ruby/site_ruby/1.8/svn/repos.rb:85:in `fs'
         from ./svnlook.rb:34:in `initialize'
         from ./svnlook.rb:538

Now, the mentioned util.rb seems to be full of Ruby magic that i'm
having a hard time debugging it. Isn't this the correct way of calling
svnlook.rb?

PS. Ending the repository path with a '/' results in a different error:

$ svnlook.rb svn/ tree
ruby: subversion/libsvn_subr/path.c:114: svn_path_join: Assertion
`is_canonical (base, blen)' failed.
Geannuleerd

This is with ruby 1.8.4 (2005-12-24) [i686-linux] on Gentoo.

What am i doing wrong?

Thanks a lot,
Kouhei S. (Guest)
on 2006-04-20 02:54
(Received via mailing list)
Hi,

In <removed_email_address@domain.invalid>
  "Ruby subversion bindings" on Thu, 20 Apr 2006 06:08:27 +0900,
  Pieter E. <removed_email_address@domain.invalid> wrote:

>
> Now, the mentioned util.rb seems to be full of Ruby magic that i'm
> having a hard time debugging it. Isn't this the correct way of calling
> svnlook.rb?

The following will solve the problem:

  % ruby -r svn/client -r svnlook.rb ...

Or, could you add

  require 'svn/client'

into the svnlook.rb.

# I'll fix the problem and commit the fix into the svn repository.

> PS. Ending the repository path with a '/' results in a different error:
>
> $ svnlook.rb svn/ tree
> ruby: subversion/libsvn_subr/path.c:114: svn_path_join: Assertion
> `is_canonical (base, blen)' failed.
> Geannuleerd
>
> This is with ruby 1.8.4 (2005-12-24) [i686-linux] on Gentoo.
>
> What am i doing wrong?

A repository path passed to Svn::Repos.open must be canonical.

If you want to use svnlook.rb with more convenience, replace
the following line in svnlook.rb (last line)

  SvnLook.new(path, rev, txn).run(cmd)

with

  SvnLook.new(basename(path), rev, txn).run(cmd)


Thanks,
Pieter E. (Guest)
on 2006-04-20 21:27
(Received via mailing list)
Kouhei S. wrote:
> # I'll fix the problem and commit the fix into the svn repository.
[...]

>>PS. Ending the repository path with a '/' results in a different error:

> A repository path passed to Svn::Repos.open must be canonical.
>
> If you want to use svnlook.rb with more convenience, replace
> the following line in svnlook.rb (last line)
>
>   SvnLook.new(path, rev, txn).run(cmd)
>
> with
>
>   SvnLook.new(basename(path), rev, txn).run(cmd)

Thanks a lot Kou!
This topic is locked and can not be replied to.