1native::Repos(3)      User Contributed Perl Documentation     native::Repos(3)
2
3
4

NAME

6       SVN::Repos - Subversion repository functions
7

SYNOPSIS

9           use SVN::Core;
10           use SVN::Repos;
11           use SVN::Fs;
12
13           my $repos = SVN::Repos::open('/path/to/repos');
14           print $repos->fs()->youngest_rev;
15

DESCRIPTION

17       SVN::Repos wraps the object-oriented "svn_repos_t" functions, providing
18       access to a Subversion repository on the local filesystem.
19
20   CONSTRUCTORS
21       SVN::Repos::open($path)
22           This function opens an existing repository, and returns an
23           "SVN::Repos" object.
24
25       create($path, undef, undef, $config, $fs_config)
26           This function creates a new repository, and returns an "SVN::Repos"
27           object.
28
29   METHODS
30       $repos->dump_fs($dump_fh, $feedback_fh, $start_rev, $end_rev,
31       $incremental, $cancel_callback)
32       $repos->dump_fs2($dump_fh, $feedback_fh, $start_rev, $end_rev,
33       $incremental, $deltify, $cancel_callback)
34           Create a dump file of the repository from revision $start_rev to
35           $end_rev , store it into the filehandle $dump_fh, and write
36           feedback on the progress of the operation to filehandle
37           $feedback_fh.
38
39           If $incremental is TRUE, the first revision dumped will be a diff
40           against the previous revision (usually it looks like a full dump of
41           the tree).
42
43           If $use_deltas is TRUE, output only node properties which have
44           changed relative to the previous contents, and output text contents
45           as svndiff data against the previous contents.  Regardless of how
46           this flag is set, the first revision of a non-incremental dump will
47           be done with full plain text.  A dump with @a use_deltas set cannot
48           be loaded by Subversion 1.0.x.
49
50           If $cancel_callback is not "undef", it must be a code reference
51           that is called periodically to determine whether the client wishes
52           to cancel the dump.  See "CANCELLATION CALLBACK" in SVN::Client for
53           details.
54
55           Example:
56
57               use SVN::Core;
58               use SVN::Repos;
59
60               my $repos = SVN::Repos::open('/repo/sandbox');
61
62               open my $fh, ">/tmp/tmp.dump" or die "Cannot open file: $!\n";
63
64               my $start_rev   = 10;
65               my $end_rev     = 20;
66               my $incremental = 1;
67               my $deltify     = 1;
68
69               $repos->dump_fs2($fh, \*STDOUT,          # Dump file => $fh, Feedback => STDOUT
70                                $start_rev, $end_rev,   # Revision Range
71                                $incremental, $deltify, # Options
72                                undef);                 # Cancel Callback
73
74               close $fh;
75
76       $repos->load_fs($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir,
77       $cancel_callback);
78       $repos->load_fs2($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir,
79       $use_pre_commit_hook, $use_post_commit_hook, $cancel_callback);
80           Loads a dumpfile specified by the $dumpfile_fh filehandle into the
81           repository.  If the dumpstream contains copy history that is
82           unavailable in the repository, an error will be thrown.
83
84           The repository's UUID will be updated iff the dumpstream contains a
85           UUID and $uuid_action is not equal to $SVN::Repos::load_uuid_ignore
86           and either the repository contains no revisions or $uuid_action is
87           equal to $SVN::Repos::load_uuid_force.
88
89           If the dumpstream contains no UUID, then $uuid_action is ignored
90           and the repository UUID is not touched.
91
92           If $parent_dir is not null, then the parser will reparent all the
93           loaded nodes, from root to @a parent_dir.  The directory
94           $parent_dir must be an existing directory in the repository.
95
96           If $use_pre_commit_hook is set, call the repository's pre-commit
97           hook before committing each loaded revision.
98
99           If $use_post_commit_hook is set, call the repository's post-commit
100           hook after committing each loaded revision.
101
102           If $cancel_callback is not "undef", it must be a code reference
103           that is called periodically to determine whether the client wishes
104           to cancel the load.  See "CANCELLATION CALLBACK" in SVN::Client for
105           details.
106
107           You must at least provide "undef" for these parameters for the
108           method call to work.
109
110           Example:
111               use SVN::Core;
112               use SVN::Repos;
113
114               my $repos = SVN::Repos::open('/repo/test_repo');
115
116               open my $fh, "/repo/sandbox.dump" or die "Cannot open file: $!\n";
117
118               my $parent_dir = '/';
119               my $use_pre_commit_hook  = 0;
120               my $use_post_commit_hook = 0;
121
122               $repos->load_fs2($fh, \*STDOUT,
123                                $SVN::Repos::load_uuid_ignore, # Ignore uuid
124                                $parent_dir,
125                                $use_pre_commit_hook,  # Use pre-commit hook?
126                                $use_post_commit_hook, # Use post-commit hook?
127                                undef, undef);
128
129
130               close $fh;
131
132       $repos->fs()
133           Returns the "SVN::Fs" object for this repository.
134
135       $repos->get_logs([$path, ...], $start, $end, $discover_changed_paths,
136       $strict_node_history, $receiver)
137           Iterates over all the revisions that affect the list of paths
138           passed as the first parameter, starting at $start, and ending at
139           $end.
140
141           $receiver is called for each change.  The arguments to $receiver
142           are:
143
144           $self
145               The "SVN::Repos" object.
146
147           $paths
148               "undef" if $discover_changed_paths is false.  Otherwise,
149               contains a hash of paths that have changed in this revision.
150
151           $rev
152               The revision this change occurred in.
153
154           $date
155               The date and time the revision occurred.
156
157           $msg
158               The log message associated with this revision.
159
160           $pool
161               An "SVN::Pool" object which may be used in the function.
162
163           If $strict_node_history is true then copies will not be traversed.
164
165   ADDITIONAL METHODS
166       The following methods work, but are not currently documented in this
167       file.  Please consult the svn_repos.h section in the Subversion API for
168       more details.
169
170       $repos->get_commit_editor(...)
171       $repos->get_commit_editor2(...)
172       $repos->path(...)
173       $repos->db_env(...)
174       $repos->lock_dir(...)
175       $repos->db_lockfile(...)
176       $repos->hook_dir(...)
177       $repos->start_commit_hook(...)
178       $repos->pre_commit_hook(...)
179       $repos->post_commit_hook(...)
180       $repos->pre_revprop_change(...)
181       $repos->post_revprop_change(...)
182       $repos->dated_revision(...)
183       $repos->fs_commit_txn(...)
184       $repos->fs_being_txn_for_commit(...)
185       $repos->fs_being_txn_for_update(...)
186       $repos->fs_change_rev_prop(...)
187       $repos->node_editor(...)
188       $repos->dump_fs(...)
189       $repos->load_fs(...)
190       $repos->get_fs_build_parser(...)
191

AUTHORS

193       Chia-liang Kao <clkao@clkao.org>
194
196           Licensed to the Apache Software Foundation (ASF) under one
197           or more contributor license agreements.  See the NOTICE file
198           distributed with this work for additional information
199           regarding copyright ownership.  The ASF licenses this file
200           to you under the Apache License, Version 2.0 (the
201           "License"); you may not use this file except in compliance
202           with the License.  You may obtain a copy of the License at
203
204             http://www.apache.org/licenses/LICENSE-2.0
205
206           Unless required by applicable law or agreed to in writing,
207           software distributed under the License is distributed on an
208           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
209           KIND, either express or implied.  See the License for the
210           specific language governing permissions and limitations
211           under the License.
212
213
214
215perl v5.36.0                      2022-10-05                  native::Repos(3)
Impressum