You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by John <js...@ecclescollege.ac.uk> on 2005/06/03 22:00:23 UTC
Perl binding question
Sorry for posting here, but I'm totally stuck.
I'm trying to query who owns a lock from perl, without shelling to svnlook. And
my perl is almost non-existent! And I can't find any docs for the bindings.
(I've been examining the .dll's in a text editor to find command names!!) So far
I've got:
my $paramrepo;
my $parampath;
my $paramuser;
my $repo;
my $fs;
my $lock;
my $pool;
$paramrepo = shift;
$parampath = shift;
$paramuser = shift;
$repo = SVN::Repos::open($paramrepo);
$fs = $repo->fs;
# $pool isn't defined - is this as bad as I think?
$lock = SVN::_Fs::svn_fs_get_lock($fs,$parampath,$pool);
if ($lock)
{
# how do I query $lock?????
print $lock, "\n";
} else
{
print "no lock\n";
}
This seems to work (should I be worried I don't have a 'pool' setup - and the
var is just undefined?).
My second question is, how do I get data out of $lock ?!?!?! $lock->owner would
seem logical, but it doesn't work.
Thanks for the help,
John
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl binding question
Posted by Chia-liang Kao <cl...@clkao.org>.
John <jsparrow <at> ecclescollege.ac.uk> writes:
> $repo = SVN::Repos::open($paramrepo);
> $fs = $repo->fs;
>
> # $pool isn't defined - is this as bad as I think?
>
> $lock = SVN::_Fs::svn_fs_get_lock($fs,$parampath,$pool);
>
> if ($lock)
> {
> # how do I query $lock?????
> print $lock, "\n";
> } else
> {
> print "no lock\n";
> }
>
> This seems to work (should I be worried I don't have a 'pool' setup - and the
> var is just undefined?).
Just leave the pool empty it will use a default one for you. Read SVN::Core
document about pool handling.
> My second question is, how do I get data out of $lock ?!?!?! $lock->owner would
> seem logical, but it doesn't work.
There's simply no object accessor declared for lock object. You can do the
raw and long version of accessor for now:
SVN::_Core::svn_lock_t_path_get($lock).
Cheers,
CLK
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org