📄 core.pm
字号:
the HACKING file and the API documentation. Looking at the implementation ofSVN::Error::croak_on_error and SVN::Error::expanded_message may be helpful aswell.=over 4=item $svn_error_t-E<gt>apr_err()APR error value, possibly SVN_ custom error.=item $svn_error_t-E<gt>message()Details from producer of error.=item $svn_error_t-E<gt>child()svn_error_t object of the error that's wrapped.=item $svn_error_t-E<gt>pool()The pool holding this error and any child errors it wraps.=item $svn_error_t-E<gt>file()Source file where the error originated.=item $svn_error_t-E<gt>line()Source line where the error originated.=item SVN::Error::strerror($apr_status_t)Returns the english description of the status code.=item $svn_error_t-E<gt>strerror()Returns the english description of the apr_err status code set on the$svn_error_t. This is short for:SVN::Error::strerror($svn_error_t-E<gt>apr_err());=item SVN::Error::create($apr_err, $child, $message);Returns a new svn_error_t object with the error status specified in $apr_err,the child as $child, and error message of $message.=item SVN::Error::quick_wrap($child, $new_msg); or $child-E<gt>quick_wrap($new_msg);A quick n' easy way to create a wrappered exception with your own messagebefore throwing it up the stack.$child is the svn_error_t object you want to wrap and $new_msg is the new errorstring you want to set.=item SVN::Error::compose($chain, $new_error); or $chain-E<gt>compose($new_error);Add new_err to the end of $chain's chain of errors.The $new_err chain will be copied into $chain's pool and destroyed, so $new_erritself becomes invalid after this function.=item SVN::Error::clear($svn_error_t); or $svn_error_t-E<gt>clear();Free the memory used by $svn_error_t, as well as all ancestors and descendantsof $svn_error_t.You must call this on every svn_error_t object you get or you will leak memory.=cut# Permit users to determine if they want automatic croaking or not.our $handler = \&croak_on_error;# Import functions that don't follow the normal naming scheme.foreach my $function (qw(handle_error handle_warning strerror)) { no strict 'refs'; my $real_function = \&{"SVN::_Core::svn_$function"}; *{"SVN::Error::$function"} = sub { return $real_function->(@_); }}=item SVN::Error::expanded_message($svn_error_t) or $svn_error_t-E<gt>expanded_message()Returns the error message by tracing through the svn_error_t object and itschildren and concatenating the error messages. This is how the internalexception handlers get their error messages.=cutsub expanded_message { my $svn_error = shift; unless (is_error($svn_error)) { return undef; } my $error_message = $svn_error->strerror(); while ($svn_error) { $error_message .= ': ' . $svn_error->message(); $svn_error = $svn_error->child(); } return $error_message;} =item SVN::Error::is_error($value)Returns true if the value is an svn_error type return. Returns false if thevalue is anything else or undefined. This is useful for seeing if a call hasreturned an error.=cutsub is_error { return (ref($_[$[]) eq '_p_svn_error_t');}=item SVN::Error::croak_on_error Default error handler. It takes an svn_error_t and extracts the error messagesfrom it and croaks with those messages.It can be used two ways. The first is detailed above as setting it as theautomatic exception handler via setting $SVN::Error::handler. The 2nd is if you have $SVN::Error::handler set to undef as a wrapper for callsyou want to croak on when there is an error but don't want to have to write anexplicit error handler for example:my $result_rev=SVN::Error::croak_on_error($ctx-E<gt>checkout($url,$path,'HEAD',1));If there is no error then croak_on_error will return the arguments passed to itunchanged.=cutsub croak_on_error { unless (is_error($_[$[])) { return @_; } my $svn_error = shift; my $error_message = $svn_error->expanded_message(); $svn_error->clear(); croak($error_message);}=item SVN::Error::confess_on_errorThe same as croak_on_error except it will give a more detailed stack backtrace.Including showing internal calls within the implementations of the perlbindings. This is useful if you're working on developing the bindings.=cutsub confess_on_error { unless (is_error($_[$[])) { return @_; } my $svn_error = shift; my $error_message = $svn_error->expanded_message(); $svn_error->clear(); confess($error_message);}=item SVN::Error::ignore_errorThis is useful for wrapping around calls which you wish to ignore any potentialerror. It checks to see if the first parameter is an error and if it is itclears it. It then returns all the other parameters.=back=cutsub ignore_error { if (is_error($_[$[])) { my $svn_error = shift; $svn_error->clear(); } return @_;}package _p_svn_log_changed_path_t;use SVN::Base qw(Core svn_log_changed_path_t_);=head2 svn_log_changed_path_t=over 4=item $lcp-E<gt>action()'A'dd, 'D'elete, 'R'eplace, 'M'odify =item $lcp-E<gt>copyfrom_path()Source path of copy (if any).=item $lcp-E<gt>copyfrom_rev()Source revision of copy (if any).=back=cutpackage SVN::Node;use SVN::Base qw(Core svn_node_);=head2 svn_node_kind_t - SVN::NodeAn enum of the following constants:$SVN::Node::none, $SVN::Node::file,$SVN::Node::dir, $SVN::Node::unknown.=cutpackage _p_svn_opt_revision_t;use SVN::Base qw(Core svn_opt_revision_t_);=head2 svn_opt_revision_t=cutpackage _p_svn_opt_revision_t_value;use SVN::Base qw(Core svn_opt_revision_t_value_);package _p_svn_config_t;use SVN::Base qw(Core svn_config_);=head2 svn_config_tOpaque object describing a set of configuration options.=cutpackage _p_svn_dirent_t;use SVN::Base qw(Core svn_dirent_t_);=head2 svn_dirent_t=over 4=item $dirent-E<gt>kind()Node kind. One of these constants:$SVN::Node::none, $SVN::Node::file,$SVN::Node::dir, $SVN::Node::unknown.=item $dirent-E<gt>size()Length of file text, or 0 for directories.=item $dirent-E<gt>has_props()Does the node have props?=item $dirent-E<gt>created_rev()Last rev in which this node changed.=item $dirent-E<gt>time()Time of created_rev (mod-time).=item $dirent-E<gt>last_author()Author of created rev.=back=cutpackage _p_svn_auth_cred_simple_t;use SVN::Base qw(Core svn_auth_cred_simple_t_);=head2 svn_auth_cred_simple_t=over 4=item $simple-E<gt>username()Username.=item $simple-E<gt>password()Password.=item $simple-E<gt>may_save()Indicates if the credentials may be saved (to disk).=back=cutpackage _p_svn_auth_cred_username_t;use SVN::Base qw(Core svn_auth_cred_username_t_);=head2 svn_auth_cred_username_t=over 4=item $username-E<gt>username()Username.=item $username-E<gt>may_save()Indicates if the credentials may be saved (to disk).=back=cutpackage _p_svn_auth_cred_ssl_server_trust_t;use SVN::Base qw(Core svn_auth_cred_ssl_server_trust_t_);=head2 svn_auth_cred_ssl_server_trust_t=over 4=item $strust-E<gt>may_save()Indicates if the credentials may be saved (to disk).=item $strust-E<gt>accepted_failures()Bit mask of the accepted failures.=back=cutpackage _p_svn_auth_ssl_server_cert_info_t;use SVN::Base qw(Core svn_auth_ssl_server_cert_info_t_);=head2 svn_auth_ssl_server_cert_info_t=over 4=item $scert-E<gt>hostname()Primary CN.=item $scert-E<gt>fingerprint()ASCII fingerprint.=item $scert-E<gt>valid_from()ASCII date from which the certificate is valid.=item $scert-E<gt>valid_until()ASCII date until which the certificate is valid.=item $scert-E<gt>issuer_dname()DN of the certificate issuer.=item $scert-E<gt>ascii_cert()Base-64 encoded DER certificate representation.=back=cutpackage _p_svn_auth_cred_ssl_client_cert_t;use SVN::Base qw(Core svn_auth_cred_ssl_client_cert_t_);=head2 svn_auth_cred_ssl_client_cert_t=over 4=item $ccert-E<gt>cert_file()Full paths to the certificate file.=item $ccert-E<gt>may_save()Indicates if the credentials may be saved (to disk).=back=cutpackage _p_svn_auth_cred_ssl_client_cert_pw_t;use SVN::Base qw(Core svn_auth_cred_ssl_client_cert_pw_t_);=head2 svn_auth_cred_ssl_client_cert_pw_t=over 4=item $ccertpw-E<gt>password()Certificate password.=item $ccertpw-E<gt>may_save()Indicates if the credentials may be saved (to disk).=back=cut=head1 CONSTANTS=head2 SVN::Auth::SSL=over 4=item $SVN::Auth::SSL::NOTYETVALIDCertificate is not yet valid.=item $SVN::Auth::SSL::EXPIREDCertificate has expired.=item $SVN::Auth::SSL::CNMISMATCHCertificate's CN (hostname) does not match the remote hostname. =item $SVN::Auth::SSL::UNKNOWNCACertificate authority is unknown (i.e. not trusted). =item $SVN::Auth::SSL::OTHEROther failure. This can happen if neon has introduced a new failure bit that wedo not handle yet.=back=cutpackage SVN::Auth::SSL;use SVN::Base qw(Core SVN_AUTH_SSL_);package _p_svn_lock_t;use SVN::Base qw(Core svn_lock_t_);package SVN::MD5;use overload '""' => sub { SVN::Core::md5_digest_to_cstring(${$_[0]})};sub new { my ($class, $digest) = @_; bless \$digest, $class;}=head1 AUTHORSChia-liang Kao E<lt>clkao@clkao.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 + -