client.pm
来自「linux subdivision ying gai ke yi le ba」· PM 代码 · 共 1,318 行 · 第 1/4 页
PM
1,318 行
cancel callback".A string, in which case the bindings will generate an svn_error_t object for youwith the error code of SVN_ERR_CANCELLED and the string set to the string youreturned.Any other value will be interpreted as wanting to continue the operation.Generally, it's best to return 0 to continue the operation.=cutsub cancel { my $self = shift; if (scalar(@_) == 1) { $self->{'cancel_callback'} = $self->{'ctx'}->cancel_baton(shift); } return ${$self->{'cancel_callback'}};}=item $ctx-E<gt>pool(new SVN::Pool);Method that sets or gets the default pool that is passed to method callsrequiring a pool, but which were not explicitly passed one.See L<SVN::Core> for more information about how pools are managedin this interface.=cutsub pool{ my $self = shift; if (scalar(@_) == 0) { $self->{'pool'}; } else { return $self->{'pool'} = shift; }}=item $ctx-E<gt>config(SVN::Core::config_get_config(undef));Method that allows access to the config member of the svn_client_ctx_t.Accepts a Perl hash to set, which is what functions likeSVN::Core:config_get_config() will return.It will return a _p_arp_hash_t scalar. This is a temporarysituation. The return value is not particular useful. Inthe future, this value will be tied to the actual hash usedby the C API.=back=cutsub config{ my $self = shift; if (scalar(@_) == 0) { return $self->{'ctx'}->config(); } else { $self->{'ctx'}->config(shift); return $self->{'ctx'}->config(); }}=head1 AUTHENTICATION PROVIDERSThe following functions get authentication providers for you.They come in two forms. Standard or File versions, which lookfor authentication information in the subversion configurationdirectory that was previously cached, or Prompt versions whichcall a subroutine to allow you to prompt the user for theinformation.The functions that return the svn_auth_provider_object_t for prompt styleproviders take a reference to a Perl subroutine to use for the callback. Thefirst parameter each of these subroutines receive is a credential object. Thesubroutines return the response by setting members of that object. Members maybe set like so: $cred-E<gt>username("breser"); These functions and credentialobjects always have a may_save member which specifies if the authenticationdata will be cached.The providers are as follows: NAME WHAT IT HANDLES ---------------- ---------------------------------------- simple username and password pairs username username only ssl_server_trust server certificates and failures authenticating them ssl_client_cert client side certificate files ssl_client_cert_pw password for a client side certificate file.=over 4=item SVN::Client::get_simple_providerReturns a simple provider that returns information from previously cachedsessions. Takes no parameters or one pool parameter.=item SVN::Client::get_simple_prompt_providerReturns a simple provider that prompts the user via a callback. Takes two orthree parameters, the first is the callback subroutine, the 2nd is the numberof retries to allow, the 3rd is optionally a pool. The subroutine gets calledwith the following parameters: a svn_auth_cred_simple_t object, a realm string,a default username, may_save, and a pool. The svn_auth_cred_simple has thefollowing members: username, password, and may_save.=item SVN::Client::get_username_providerReturns a username provider that returns information from a previously cachedsessions. Takes no parameters or one pool parameter.=item SVN::Client::get_username_prompt_providerReturns a username provider that prompts the user via a callback. Takes two orthree parameters, the first is the callback subroutine, the 2nd is the numberof retries to allow, the 3rd is optionally a pool. The subroutine gets calledwith the following parameters: a svn_auth_cred_username_t object, a realmstring, a default username, may_save, and a pool. The svn_auth_cred_usernamehas the following members: username and may_save.=item SVN::Client::get_ssl_server_trust_file_providerReturns a server trust provider that returns information from previouslycached sessions. Takes no parameters or optionally a pool parameter.=item SVN::Client::get_ssl_server_trust_prompt_providerReturns a server trust provider that prompts the user via a callback. Takesone or two parameters the callback subroutine and optionally a pool parameter.The subroutine gets called with the following parameters. Asvn_auth_cred_ssl_server_trust_t object, a realm string, an integer specifyinghow the certificate failed authentication, a svn_auth_ssl_server_cert_info_tobject, may_save, and a pool. The svn_auth_cred_ssl_server_trust_t object hasthe following members: may_save and accepted_failures. Thesvn_auth_ssl_server_cert_info_t object has the following members (and behavesjust like cred objects though you can't modify it): hostname, fingerprint,valid_from, valid_until, issuer_dname, ascii_cert.The masks used for determining the failures are in SVN::Auth::SSL and are named:$SVN::Auth::SSL::NOTYETVALID$SVN::Auth::SSL::EXPIRED$SVN::Auth::SSL::CNMISMATCH$SVN::Auth::SSL::UNKNOWNCA$SVN::Auth::SSL::OTHERYou reply by setting the accepted_failures of the cred object with an integer of the values for what you want to accept bitwise AND'd together.=item SVN::Client::get_ssl_cert_file_providerReturns a client certificate provider that returns information from previouslycached sessions. Takes no parameters or optionally a pool parameter.=item SVN::Client::get_ssl_cert_prompt_providerReturns a client certificate provider that prompts the user via a callback.Takes two or three parameters: the first is the callback subroutine, the 2nd isthe number of retries to allow, the 3rd is optionally a pool parameter. Thesubroutine gets called with the following parameters. Asvn_auth_cred_ssl_client_cert object, a realm string, may_save, and a pool.The svn_auth_cred_ssl_client_cert the following members: cert_file andmay_save.=item SVN::Client::get_ssl_cert_pw_file_providerReturns a client certificate password provider that returns information frompreviously cached sessions. Takes no parameters or optionally a poolparameter.=item SVN::Client::get_ssl_cert_pw_prompt_providerReturns a client certificate password provider that prompts the user via acallback. Takes two or three parameters, the first is the callback subroutine,the 2nd is the number of retries to allow, the 3rd is optionally a poolparameter. The subroutine gets called with the following parameters. Asvn_auth_cred_ssl_client_cert_pw object, a realm string, may_save, and a pool.The svn_auth_cred_ssl_client_cert_pw has the following members: password andmay_save.=back =head1 OBJECTSThese are some of the object types that are returned from the methodsand functions. Others are documented in L<SVN::Core> and L<SVN::Wc>.If an object is not documented, it is more than likely opaque and not something you can do anything with, except pass to other functionsthat require such objects.=cutpackage _p_svn_client_commit_info_t;use SVN::Base qw(Client svn_client_commit_info_t_);=head2 svn_client_commit_item_t=over 8=item $citem-E<gt>path()Absolute working-copy path of item.=item $citem-E<gt>kind()An integer representing the type of node it is (file/dir).Can be one of the following constants:$SVN::Node::none$SVN::Node::file$SVN::Node::dir$SVN::Node::unknown=item $citem-E<gt>url()Commit URL for this item.=item $citem-E<gt>revision()Revision (copyfrom_rev if state_flags has IS_COPY set).=item $citem-E<gt>copyform_url();CopyFrom URL=item $citem-E<gt>state_flags();One of several state flags:$SVN::Client::COMMIT_ITEM_ADD$SVN::Client::COMMIT_ITEM_DELETE$SVN::Client::COMMIT_ITEM_TEXT_MODS$SVN::Client::COMMIT_ITEM_PROP_MODS$SVN::Client::COMMIT_ITEM_IS_COPY=item $citem>wcprop_changes()A reference to an array of svn_prop_t objects represent changesto wc properties.=back=cutpackage _p_svn_client_commit_item_t;use SVN::Base qw(Client svn_client_commit_item_t_);=head2 svn_client_commit_info_t=over 4=item $cinfo-E<gt>revision()Just committed revision.=item $cinfo-E<gt>date()Server-Side date of the commit as a string.=item $cinfo-E<gt>author()Author of the commit.=back=cutpackage _p_svn_client_ctx_t;use SVN::Base qw(Client svn_client_ctx_t_);package _p_svn_client_proplist_item_t;use SVN::Base qw(Client svn_client_proplist_item_t_);=head2 svn_client_proplist_item_t=over 8=item $proplist-E<gt>node_name()The name of the node on which these properties are set.=item $proplist-E<gt>prop_hash()A reference to a hash of property names and values.=back=head1 TODO* Better support for the config.* Unit tests for cleanup, diff, export, merge, move, relocate, resolved and switch. This may reveal problems for using these methods as I haven'ttested them yet that require deeper fixes.=head1 AUTHORSChia-liang Kao E<lt>clkao@clkao.orgE<gt>Ben Reser E<lt>ben@reser.orgE<gt>=head1 COPYRIGHTCopyright (c) 2003 CollabNet. All rights reserved.This software is licensed as described in the file COPYING, which youshould have received as part of this distribution. The terms are alsoavailable at http://subversion.tigris.org/license-1.html. If newerversions of this license are posted there, you may use a newer versioninstead, at your option.This software consists of voluntary contributions made by manyindividuals. For exact contribution history, see the revision historyand logs, available at http://subversion.tigris.org/.=cut1;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?