1native::Delta(3) User Contributed Perl Documentation native::Delta(3)
2
3
4
6 SVN::Delta - Subversion delta functions
7
9 require SVN::Core;
10 require SVN::Repos;
11 require SVN::Delta;
12
13 # driving an editor
14 my $editor = SVN::Delta::Editor->
15 new(SVN::Repos::get_commit_editor($repos, "file://$repospath",
16 '/', 'root', 'FOO', \&committed));
17
18 my $rootbaton = $editor->open_root(0);
19
20 my $fbaton = $editor->add_file('filea', $rootbaton,
21 undef, -1);
22
23 my $ret = $editor->apply_textdelta($fbaton, undef);
24 SVN::TxDelta::send_string("FILEA CONTENT", @$ret);
25
26 # implement an editor in perl
27 SVN::Repos::dir_delta($root1, $path, undef,
28 $root2, $path,
29 SVN::Delta::Editor->new(_debug=>1),
30 1, 1, 0, 1
31
33 SVN::Delta wraps delta related function in subversion. The most
34 important one is SVN::Delta::Editor, the interface for describing tree
35 deltas. by default SVN::Delta::Editor relays method calls to its
36 internal member "_editor", which could either be an editor in C (such
37 as the one you get from get_commit_editor), or another
38 SVN::Delta::Editor object.
39
41 Driving Editors
42 If you want to drive a native editor (such as commit_editor obtained by
43 SVN::Repos::get_commit_editor), create a SVN::Delta::Editor object with
44 the native editor/baton pair. The object will then be ready to use and
45 its method calls will be relayed to the native editor.
46
47 Implementing Editors
48 If you want to implement an editor, subclass SVN::Delta::Editor and
49 implement the editors callbacks. see the METHODS section below.
50
51 CONSTRUCTOR - new(...)
52 new($editor, $editor_baton)
53 Link to the native editor
54
55 You can also pass a hash array to new:
56
57 _debug
58 Turn on debug.
59
60 _editor
61 An arrayref of the editor/baton pair or another SVN::Delta::Editor
62 object to link with.
63
64 METHODS
65 Please consult the svn_delta.h section in the Subversion API. Member
66 functions of svn_delta_editor_t could be called as methods of
67 SVN::Delta::Editor objects, with the edit_baton omitted. The pool is
68 also optional.
69
70 If you are subclassing, the methods take exactly the same arguments as
71 the member functions (note that void ** are returned data though as
72 throughout the perl bindings), with the edit_baton omitted.
73
75 Functions returning editor/baton pair should really be typemapped to a
76 SVN::Delta::Editor object.
77
79 Chia-liang Kao <clkao@clkao.org>
80
82 Licensed to the Apache Software Foundation (ASF) under one
83 or more contributor license agreements. See the NOTICE file
84 distributed with this work for additional information
85 regarding copyright ownership. The ASF licenses this file
86 to you under the Apache License, Version 2.0 (the
87 "License"); you may not use this file except in compliance
88 with the License. You may obtain a copy of the License at
89
90 http://www.apache.org/licenses/LICENSE-2.0
91
92 Unless required by applicable law or agreed to in writing,
93 software distributed under the License is distributed on an
94 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
95 KIND, either express or implied. See the License for the
96 specific language governing permissions and limitations
97 under the License.
98
99
100
101perl v5.32.1 2021-02-10 native::Delta(3)