NAME
SVN::Repos - Subversion repository functions
SYNOPSIS
use SVN::Core;use SVN::Repos;use SVN::Fs;my $repos = SVN::Repos::open('/path/to/repos');print $repos->fs()->youngest_rev;
DESCRIPTION
SVN::Repos wraps the object-oriented "svn_repos_t" functions, providing access to a Subversion repository on the local filesystem.
CONSTRUCTORS
- SVN::Repos::open($path)
-
This function opens an existing repository, and returns an
"SVN::Repos"object.
- create($path, undef, undef, $config, $fs_config)
-
This function creates a new repository, and returns an
"SVN::Repos"object.
METHODS
- $repos->dump_fs($dump_fh, $feedback_fh, $start_rev, $end_rev, $incremental, $cancel_callback)
- $repos->dump_fs2($dump_fh, $feedback_fh, $start_rev, $end_rev, $incremental, $deltify, $cancel_callback)
-
Create a dump file of the repository from revision
$start_revto$end_rev, store it into the filehandle$dump_fh, and write feedback on the progress of the operation to filehandle$feedback_fh.If
$incrementalis TRUE, the first revision dumped will be a diff against the previous revision (usually it looks like a full dump of the tree).If
$use_deltasis TRUE, output only node properties which have changed relative to the previous contents, and output text contents as svndiff data against the previous contents. Regardless of how this flag is set, the first revision of a non-incremental dump will be done with full plain text. A dump with@ause_deltas set cannot be loaded by Subversion 1.0.x.If
$cancel_callbackis not"undef", it must be a code reference that is called periodically to determine whether the client wishes to cancel the dump. See "CANCELLATION CALLBACK" in SVN::Client for details.Example:
use SVN::Core;use SVN::Repos;my $repos = SVN::Repos::open('/repo/sandbox');open my $fh, ">/tmp/tmp.dump" or die "Cannot open file: $!\n";my $start_rev = 10;my $end_rev = 20;my $incremental = 1;my $deltify = 1;$repos->dump_fs2($fh, \*STDOUT, # Dump file => $fh, Feedback => STDOUT$start_rev, $end_rev, # Revision Range$incremental, $deltify, # Optionsundef); # Cancel Callbackclose $fh;
- $repos->load_fs($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir, $cancel_callback);
- $repos->load_fs2($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir, $use_pre_commit_hook, $use_post_commit_hook, $cancel_callback);
-
Loads a dumpfile specified by the
$dumpfile_fhfilehandle into the repository. If the dumpstream contains copy history that is unavailable in the repository, an error will be thrown.The repository's UUID will be updated iff the dumpstream contains a UUID and
$uuid_actionis not equal to$SVN::Repos::load_uuid_ignoreand either the repository contains no revisions or$uuid_actionis equal to$SVN::Repos::load_uuid_force.If the dumpstream contains no UUID, then
$uuid_actionis ignored and the repository UUID is not touched.If
$parent_diris not null, then the parser will reparent all the loaded nodes, from root to@aparent_dir. The directory$parent_dirmust be an existing directory in the repository.If
$use_pre_commit_hookis set, call the repository's pre-commit hook before committing each loaded revision.If
$use_post_commit_hookis set, call the repository's post-commit hook after committing each loaded revision.If
$cancel_callbackis not"undef", it must be a code reference that is called periodically to determine whether the client wishes to cancel the load. See "CANCELLATION CALLBACK" in SVN::Client for details.You must at least provide
"undef"for these parameters for the method call to work.Example:
use SVN::Core;
use SVN::Repos;my $repos = SVN::Repos::open('/repo/test_repo');open my $fh, "/repo/sandbox.dump" or die "Cannot open file: $!\n";my $parent_dir = '/';my $use_pre_commit_hook = 0;my $use_post_commit_hook = 0;$repos->load_fs2($fh, \*STDOUT,$SVN::Repos::load_uuid_ignore, # Ignore uuid$parent_dir,$use_pre_commit_hook, # Use pre-commit hook?$use_post_commit_hook, # Use post-commit hook?undef, undef);close $fh;
- $repos->fs()
-
Returns the
"SVN::Fs"object for this repository.
- $repos->get_logs([$path, ...], $start, $end, $discover_changed_paths, $strict_node_history, $receiver)
-
Iterates over all the revisions that affect the list of paths passed as the first parameter, starting at
$start, and ending at$end.$receiveris called for each change. The arguments to$receiverare:- $self
-
The
"SVN::Repos"object.
- $paths
-
"undef"if$discover_changed_pathsis false. Otherwise, contains a hash of paths that have changed in this revision.
- $rev
-
The revision this change occurred in.
- $date
-
The date and time the revision occurred.
- $msg
-
The log message associated with this revision.
- $pool
-
An
"SVN::Pool"object which may be used in the function.
If
$strict_node_historyis true then copies will not be traversed.
ADDITIONAL METHODS
The following methods work, but are not currently documented in this file. Please consult the svn_repos.h section in the Subversion API for more details.
- $repos->get_commit_editor(...)
- $repos->get_commit_editor2(...)
- $repos->path(...)
- $repos->db_env(...)
- $repos->lock_dir(...)
- $repos->db_lockfile(...)
- $repos->hook_dir(...)
- $repos->start_commit_hook(...)
- $repos->pre_commit_hook(...)
- $repos->post_commit_hook(...)
- $repos->pre_revprop_change(...)
- $repos->post_revprop_change(...)
- $repos->dated_revision(...)
- $repos->fs_commit_txn(...)
- $repos->fs_being_txn_for_commit(...)
- $repos->fs_being_txn_for_update(...)
- $repos->fs_change_rev_prop(...)
- $repos->node_editor(...)
- $repos->dump_fs(...)
- $repos->load_fs(...)
- $repos->get_fs_build_parser(...)
AUTHORS
Chia-liang Kao <[email protected]>
COPYRIGHT
Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements. See the NOTICE filedistributed with this work for additional informationregarding copyright ownership. The ASF licenses this fileto you under the Apache License, Version 2.0 (the"License"); you may not use this file except in compliancewith the License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,software distributed under the License is distributed on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied. See the License for thespecific language governing permissions and limitationsunder the License.