📄 client.pm
字号:
the 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_info_t;use SVN::Base qw(Client svn_info_t_);=head2 svn_info_t=over 8=item $info->URL()Where the item lives in the repository.=item $info->rev()The revision of the object. If path_or_url is a working-copypath, then this is its current working revnum. If path_or_urlis a URL, then this is the repos revision that path_or_url lives in.=item $info->kind()The node's kind.=item $info->repos_root_URL()The root URL of the repository.=item $info->repos_UUID()The repository's UUID.=item $info->last_changed_rev()The last revision in which this object changed.=item $info->last_changed_date()The date of the last_changed_rev.=item $info->last_changed_author()The author of the last_changed_rev.=item $info->lock()An exclusive lock, if present. Could be either local or remote.=backSee SVN::Wc::svn_wc_entry_t for the rest of these. svn_client.h indicatesthat these were copied from that struct and mean the same things. They arealso only useful when working with a WC.=over 8=item $info->has_wc_info()=item $info->schedule()=item $info->copyfrom_url()=item $info->copyfrom_rev()=item $info->text_time()=item $info->prop_time()=item $info->checksum()=item $info->conflict_old()=item $info->conflict_new()=item $info->conflict_wrk()=item $info->prejfile()=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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -