native::Delta(3perl)
π NAME π
SVN::Delta β Subversion delta functions, bestie. that's the whole vibe.
β¨ SYNOPSIS β¨
okay so here's the tea, literally copy-paste energy:
require SVN::Core;
require SVN::Repos;
require SVN::Delta;
# driving an editor
my $editor = SVN::Delta::Editor->
new(SVN::Repos::get_commit_editor($repos, "file://$repospath",
'/', 'root', 'FOO', \&committed));
my $rootbaton = $editor->open_root(0);
my $fbaton = $editor->add_file('filea', $rootbaton,
undef, -1);
my $ret = $editor->apply_textdelta($fbaton, undef);
SVN::TxDelta::send_string("FILEA CONTENT", @$ret);
# implement an editor in perl
SVN::Repos::dir_delta($root1, $path, undef,
$root2, $path,
SVN::Delta::Editor->new(_debug=>1),
1, 1, 0, 1
no cap, that's exactly it. π
πΈ DESCRIPTION πΈ
so SVN::Delta wraps all the delta-related functions up in subversion, and the main character of the whole thing is SVN::Delta::Editor β that's the interface for describing tree deltas. by default, SVN::Delta::Editor just relays every method call to its internal member "_editor", which could either be an editor in C (like the one you get from get_commit_editor) β¨ or literally just another SVN::Delta::Editor object. either way, she's serving.
π¦ SVN::Delta::Editor π¦
π« Driving Editors π«
if you wanna drive a native editor (like commit_editor, the one you get from SVN::Repos::get_commit_editor), you just create a SVN::Delta::Editor object with the native editor/baton pair. then the object is ready to go and its method calls get relayed straight to the native editor. easy. iconic. π«Ά
π Implementing Editors π
if you wanna implement an editor, subclass SVN::Delta::Editor and implement the editor's callbacks. go peek at the METHODS section below, bestie. π
π CONSTRUCTOR - new(...) π
new($editor, $editor_baton)β link to the native editor
you can also pass a hash array to new, and here are the keys:
_debugβ turn on debug. π_editorβ an arrayref of the editor/baton pair, or anotherSVN::Delta::Editorobject to link with.
β METHODS β
pls consult the svn_delta.h section in the Subversion API, fr fr. member functions of svn_delta_editor_t can be called as methods of SVN::Delta::Editor objects, with the edit_baton omitted. the pool is also optional, she's flexible like that. π
if you're subclassing, the methods take exactly the same arguments as the member functions (note that void ** are returned data though, as throughout the perl bindings), with the edit_baton omitted. don't come for me about the void **, that's just how it is.
π BUGS π
functions returning editor/baton pair should really be typemapped to a SVN::Delta::Editor object. it's giving unfinished business, ngl. π
π AUTHORS π
Chia-liang Kao <clkao@clkao.org> β shoutout to the legend. π
π COPYRIGHT π
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless 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 ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
okay that's the whole page bestie, you ate. this was perl v5.40.1, dated 2025-04-06 β stay slay, drink water, and go read your docs. πβ¨ππ¦
π¦ where this page comes from
- debian trixie: libsvn-perl 1.14.5-3 Β· Apache-2.0
- ubuntu questing: libsvn-perl 1.14.5-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms