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_func, $cancel_baton)
32       $repos->dump_fs2($dump_fh, $feedback_fh, $start_rev, $end_rev,
33       $incremental, $deltify, $cancel_func, $cancel_baton)
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           According to svn_repos.h, the $cancel_func is a function that is
51           called periodically and given $cancel_baton as a parameter to
52           determine whether the client wishes to cancel the dump.  You must
53           supply "undef" at the very least.
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, undef);          # Cancel Function
73
74               close $fh;
75
76       $repos->load_fs($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir,
77       $cancel_func, $cancel_baton);
78       $repos->load_fs2($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir,
79       $use_pre_commit_hook, $use_post_commit_hook, $cancel_func,
80       $cancel_baton);
81           Loads a dumpfile specified by the $dumpfile_fh filehandle into the
82           repository.  If the dumpstream contains copy history that is
83           unavailable in the repository, an error will be thrown.
84
85           The repository's UUID will be updated iff the dumpstream contains a
86           UUID and $uuid_action is not equal to $SVN::Repos::load_uuid_ignore
87           and either the repository contains no revisions or $uuid_action is
88           equal to $SVN::Repos::load_uuid_force.
89
90           If the dumpstream contains no UUID, then $uuid_action is ignored
91           and the repository UUID is not touched.
92
93           If $parent_dir is not null, then the parser will reparent all the
94           loaded nodes, from root to @a parent_dir.  The directory
95           $parent_dir must be an existing directory in the repository.
96
97           If $use_pre_commit_hook is set, call the repository's pre-commit
98           hook before committing each loaded revision.
99
100           If $use_post_commit_hook is set, call the repository's post-commit
101           hook after committing each loaded revision.
102
103           If $cancel_func is not NULL, it is called periodically with
104           $cancel_baton as argument to see if the client wishes to cancel the
105           load.
106
107           You must at least provide undef for these parameters for the method
108           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 occured in.
153
154           $date
155               The date and time the revision occured.
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       Copyright (c) 2003-2006 CollabNet.  All rights reserved.
197
198       This software is licensed as described in the file COPYING, which you
199       should have received as part of this distribution.  The terms are also
200       available at http://subversion.tigris.org/license-1.html.  If newer
201       versions of this license are posted there, you may use a newer version
202       instead, at your option.
203
204       This software consists of voluntary contributions made by many
205       individuals.  For exact contribution history, see the revision history
206       and logs, available at http://subversion.tigris.org/.
207
208
209
210perl v5.10.1                      2008-03-17                  native::Repos(3)
Impressum