in reply to SVN::Client subclassing issue
Ok, after some digging I believe I understand the issue. In the Client.pm file as it creates functions there is a section of code that adjusts the call parameters. Specifically, it checks if the first function is blessed into 'SVN::Client'. If it is, the arguments are handled in one manner. If it is not, they are handled a different way.
# import methods into our name space and wrap them in a closure # to support method calling style $ctx->log() foreach my $function (@_all_fns) { no strict 'refs'; my $real_function = \&{"SVN::_Client::svn_client_$function"}; *{"SVN::Client::$function"} = sub { my ($self, $ctx); my @args; # Don't shift the first param if it isn't a SVN::Client # object. This lets the old style interface still work. # And is useful for functions like url_from_path which # don't take a ctx param, but might be called in method # invocation style or as a normal function. for (my $index = $[; $index <= $#_; $index++) { if (ref($_[$index]) eq 'SVN::Client') { ($self) = splice(@_,$index,1); $ctx = $self->{'ctx'}; last; } elsif (ref($_[$index]) eq '_p_svn_client_ctx_t') { $self = undef; ($ctx) = splice(@_,$index,1); last; } }
This seems to mean I can't directly subclass SVN::Client as at least some of the functions break. However, I have found a couple obscure mentions of subclassing SVN::Client in my research...so I find that strange.
Guess I look for another way unless I want to modify Client.pm...which I don't :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SVN::Client subclassing issue
by Anonymous Monk on Sep 27, 2011 at 19:42 UTC | |
by tj_thompson (Monk) on Sep 27, 2011 at 19:54 UTC | |
by tye (Sage) on Sep 27, 2011 at 20:20 UTC | |
by Anonymous Monk on Sep 27, 2011 at 20:21 UTC |