📄 client.pm
字号:
The notify callback is called for each item deleted with the path ofthe deleted item.Has no return.=item $ctx-E<gt>diff($diff_options, $target1, $revision1, $target2, $revision2, $recursive, $ignore_ancestry, $no_diff_deleted, $outfile, $errfile, $pool);Produces diff output which describes the delta between $target1 at$revision1 and $target2 at $revision2. They both must represent the samenode type (i.e. they most both be directories or files). The revisionsmust not be undef. Prints the output of the diff to the filename or filehandle passed as$outfile, and any errors to the filename or filehandle passed as $errfile.Use $ignore_ancestry to control whether or not items being diffed will bechecked for relatedness first. Unrelated items are typically transmitted tothe editor as a deletion of one thing and the addition of another, but if thisflag is true, unrelated items will be diffed as if they were related.If $no_diff_deleted is true, then no diff output will be generated on deletedfiles.$diff_options is a reference to an array of additional arguments to pass todiff process invoked to compare files. You'll usually just want to use [] topass an empty array to return a unified context diff (like `diff -u`).Has no return.=item $ctx-E<gt>export($from, $to, $revision, $force, $pool);Export the contents of either a subversion repository or a subversionworking copy into a 'clean' directory (meaning a directory with noadministrative directories).$from is either the path to the working copy on disk, or a URLto the repository you wish to export.$to is the path to the directory where you wish to create the exportedtree.$revision is the revision that should be exported, which is only usedwhen exporting from a repository. It may be undef otherwise.The notify callback will be called for the items exported.Returns the value of the revision actually exported or$SVN::Core::INVALID_REVNUM for local exports.=item $ctx-E<gt>import($path, $url, $nonrecursive, $pool);Import file or directory $path into repository directory $url at head.If some components of $url do not exist then create parent directoriesas necessary.If $path is a directory, the contents of that directory are importeddirectly into the directory identified by $url. Note that the directory $path itself is not imported; that is, the basename of $path is not partof the import.If $path is a file, then the dirname of $url is the directory receiving theimport. The basename of $url is the filename in the repository. In this caseif $url already exists, raise an error.The notify callback (if defined) will be called as the import progresses, withany of the following actions: $SVN::Wc::Notify::Action::commit_added,$SVN::Wc::Notify::Action::commit_postfix_txdelta.Use $nonrecursive to indicate that imported directories should not recurseinto any subdirectories they may have.Uses the log_msg callback to determine the log message for the commit whenone is needed.Returns a svn_client_commit_info_t object. =item $ctx-E<gt>log($targets, $start, $end, $discover_changed_paths, $strict_node_history, \&log_receiver, $pool);Invoke the log_receiver subroutine on each log_message from $start to $end inturn, inclusive (but will never invoke receiver on a given log message morethan once).$targets is a reference to an array containing all the paths or URLs forwhich the log messages are desired. The log_receiver is only invoked onmessages whose revisions involved a change to some path in $targets.If $discover_changed_paths is set, then the changed_paths argument to thelog_receiver routine will be passed on each invocation.If $strict_node_history is set, copy history (if any exists) will not betraversed while harvesting revision logs for each target.If $start or $end is undef the arp_err code will be set to:$SVN::Error::CLIENT_BAD_REVISION.Special case for repositories at revision 0:If $start is 'HEAD' and $end is 1, then handle an empty (no revisions)repository specially: instead of erroring because requested revision 1when the highest revision is 0, just invoke $log_receiver on revision 0,passing undef to changed paths and empty strings for the author and date.This is because that particular combination of $start and $end usually indicatesthe common case of log invocation; the user wants to see all log messages fromyoungest to oldest, where the oldest commit is revision 1. That works fine,except there are no commits in the repository, hence this special case.Calls the notify subroutine with a $SVN::Wc::Notify::Action::skip signal on anyunversioned targets.The log_receiver takes the following arguments:$changed_paths, $revision, $author, $date, $message, $poolIt is called once for each log $message from the $revisionon $date by $author. $author, $date or $message may be undef.If $changed_paths is defined it references a hash with the keysevery path committed in $revision; the values are svn_log_changed_path_tobjects. =item $ctx-E<gt>ls($target, $revision, $recursive, $pool);Returns a hash of svn_dirent_t objects for $target at $revision.If $target is a directory, returns entries for all of the directories'contents. If $recursive is true, it will recurse subdirectories in $target.If $target is a file only return an entry for the file.If $target is non-existent, raises the $SVN::Error::FS_NOT_FOUNDerror. =item $ctx-E<gt>merge($src1, $rev1, $src2, $rev2, $target_wcpath, $recursive, $ignore_ancestry, $force, $dry_run, $pool);Merge changes from $src1/$rev1 to $src2/$rev2 into the working-copy path$target_wcpath.$src1 and $src2 are either URLs that refer to entries in the repository, orpaths to entries in the working copy.By 'merging', we mean: apply file differences and schedule additions &deletions when appropriate.$src1 and $src2 must both represent the same node kind; that is, if $src1is a directory, $src2 must also be, and if $src1 is a file, $src2 must also be.If either $rev1 or $rev2 is undef raises the $SVN::Error::CLIENT_BAD_REVISIONerror.If $recursive is true (and the URLs are directories), apply changes recursively;otherwise, only apply changes in the current directory.Use $ignore_ancestry to control whether or not items being diffed will bechecked for relatedness first. Unrelated items are typically transmittedto the editor as a deletion of one thing and the addition of another, butif this flag is true, unrelated items will be diffed as if they were related.If $force is not set and the merge involves deleting locally modified orunversioned items the operation will raise an error. If $force is set suchitems will be deleted.Calls the notify callback once for each merged target, passing the targetslocal path.If $dry_run is true the merge is carried out, and the full notificationfeedback is provided, but the working copy is not modified.Has no return.=item $ctx-E<gt>mkdir($targets, $pool);Create a directory, either in a repository or a working copy.If $targets contains URLs, immediately attempts to commit the creation of thedirectories in $targets in the repository. Returns a svn_client_commit_info_tobject.Else, create the directories on disk, and attempt to schedule them for addition.In this case returns undef.Calls the notify callback when the directory has been created (successfully)in the working copy, with the path of the new directory. Note this is onlycalled for items added to the working copy.=item $ctx-E<gt>move($src_path, $src_revision, $dst_path, $force, $pool);Move $src_path to $dst_path.$src_path must be a file or directory under version control, or the URL of a versioned item in the repository.If $src_path is a repository URL:* $dst_path must also be a repository URL (existent or not).* $src_revision is used to choose the revision from which to copy the $src_path.* The log_msg callback will be called for the commit log message.* The move operation will be immediately committed. If the commit succeeds,returns a svn_client_commit_info_t object.If $src_path is a working copy path* $dst_path must also be a working copy path (existent or not).* $src_revision is ignored and may be undef. The log_msg callback willnot be called.* This is a scheduling operation. No changes will happen to the repositoryuntil a commit occurs. This scheduling can be removed with $ctx-E<gt>revert().If $src_path is a file it is removed from the working copy immediately.If $src_path is a directory it will remain in the working copy but allfiles, and unversioned items, it contains will be removed.* If $src_path contains locally modified and/or unversioned items and $force isnot set, the copy will raise an error. If $force is set such items will beremoved.The notify callback will be called twice for each item moved, once toindicate the deletion of the moved node, and once to indicate the additionof the new location of the node.=item $ctx-E<gt>propget($propname, $target, $revision, $recursive, $pool);Returns a reference to a hash containing paths or URLs, prefixed by $target (aworking copy or URL), of items for which the property $propname is set, andwhose values represent the property value for $propname at that path.=item $ctx-E<gt>proplist($target, $revision, $recursive, $pool);Returns a reference to an array of svn_client_proplist_item_t objects.For each item the node_name member of the proplist_item object containsthe name relative to the same base as $target.If $revision is undef, then get properties from the working copy, if$target is a working copy, or from the repository head if $target is a URL.Else get the properties as of $revision. If $recursive is false, or $target is a file, the returned array will onlycontain a single element. Otherwise, it will contain one entry for eachversioned entry below (and including) $target.If $target is not found, raises the $SVN::Error::ENTRY_NOT_FOUND error.=item $ctx-E<gt>propset($propname, $propval, $target, $recursive, $pool);Set $propname to $propval on $target (a working copy or URL path).If $recursive is true, then $propname will be set recursively on $targetand all children. If $recursive is false, and $target is a directory,$propname will be set on B<only> $target.A $propval of undef will delete the property.If $propname is an svn-controlled property (i.e. prefixed with svn:),then the caller is responsible for ensuring that $propval is UTF8-encodedand uses LF line-endings.=item $ctx-E<gt>relocate($dir, $from, $to, $recursive, $pool);Modify a working copy directory $dir, changing any repository URLs thatbegin with $from to begin with $to instead, recursing into subdirectories if$recursive is true.Has no return.=item $ctx-E<gt>resolved($path, $recursive, $pool);Removed the 'conflicted' state on a working copy path.This will not semantically resolve conflicts; it just allows $path to becommitted in the future. The implementation details are opaque. If$recursive is set, recurse below $path, looking for conflicts toresolve.If $path is not in a state of conflict to begin with, do nothing.If $path's conflict state is removed, call the notify callback with the$path.=item $ctx-E<gt>revert($paths, $recursive, $pool); Restore the pristine version of a working copy $paths, effectively undoingany local mods. For each path in $paths, if it is a directory and $recursiveis true, this will be a recursive operation.=item $ctx-E<gt>revprop_get($propname, $url, $revision, $pool);Returns two values, the first of which is the value of $propname on revision$revision in the repository represented by $url. The second value is theactual revision queried.Note that unlike its cousin $ctx-E<gt>propget(), this routine doesn't affectworking copy at all; it's a pure network operation that queries anB<unversioned> property attached to a revision. This can be used to querylog messages, dates, authors, and the like.=item $ctx-E<gt>revprop_list($url, $revision, $pool);Returns two values, the first of which is a reference to a hash containingthe properties attached to $revision in the repository represented by $url.The second value is the actual revision queried.Note that unlike its cousin $ctx-E<gt>proplist(), this routine doesn't read aworking copy at all; it's a pure network operation that reads B<unversioned>properties attached to a revision.=item $ctx-E<gt>revprop_set($propname, $propval, $url, $revision, $force, $pool);Set $propname to $propval on revision $revision in the repository representedby $url.Returns the actual revision affected. A $propval of undef will delete theproperty.If $force is true, allow newlines in the author property.If $propname is an svn-controlled property (i.e. prefixed with svn:), thenthe caller is responsible for ensuring that the value is UTF8-encoded anduses LF line-endings.Note that unlike its cousin $ctx-E<gt>propset(), this routine doesn't affectthe working copy at all; it's a pure network operation that changes anB<unversioned> property attached to a revision. This can be used to tweaklog messages, dates, authors, and the like. Be careful: it's a lossyoperation, meaning that any existing value is replaced with the new value,with no way to retrieve the prior value.Also note that unless the administrator creates a pre-revprop-change hookin the repository, this feature will fail.=item $ctx-E<gt>status($path, $revision, \&status_func, $recursive, $get_all, $update, $no_ignore, $pool);Given $path to a working copy directory (or single file), call status_func()with a set of svn_wc_status_t objects which describe the status of $path andits children.If $recursive is true, recurse fully, else do only immediate children.If $get_all is set, retrieve all entries; otherwise, retrieve only 'interesting'entries (local mods and/or out-of-date).If $update is set, contact the repository and augment the status objects withinformation about out-of-dateness (with respect to $revision). Also, willreturn the value of the actual revision against with the working copy wascompared. (The return will be undef if $update is not set).The function recurses into externals definitions ('svn:externals') afterhandling the main target, if any exist. The function calls the notify callbackwith $SVN::Wc::Notify::Action::status_external action before handling eachexternals definition, and with $SVN::Wc::Notify::Action::status_completedafter each.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -