native::Fs(3)
π native::Fs(3) β the Subversion filesystem, but make it make sense π
okay so bestie, welcome to native::Fs(3) (that's the manual page name, she's a Perl module doc from the User Contributed Perl Documentation corner of the internet π«Ά). If you've ever wanted to poke at Subversion's guts from Perl, this is your girl.
β¨ NAME β¨
SVN::Fs β Subversion filesystem functions. that's it, that's the name, and she ate π
πΈ DESCRIPTION πΈ
So basically: SVN::Fs wraps all the functions in svn_fs.h. The actual namespace for filesystem objects is _p_svn_fs_t. iykyk. π
π₯ FUNCTIONS π₯
here's the whole roster, no skips, no cuts, we don't do that here:
SVN::Fs::berkeley_logfiles($path, $only_unused)SVN::Fs::berkeley_recover($path)SVN::Fs::check_related($id1, $id2)SVN::Fs::compare_ids($id1, $id2)SVN::Fs::contents_changed($root1, $path1, $root2, $path2)SVN::Fs::create($path, $config)SVN::Fs::delete_fs($path)SVN::Fs::deltify_revision($fs, $rev)SVN::Fs::get_file_delta_stream($source_root, $source_path, $target_root, $target_path)SVN::Fs::hotcopy($src_path, $dest_path, $clean)SVN::Fs::initialize($pool)SVN::Fs::merge($source_root, $source_path, $target_root, $target_path, $ancestor_root, $ancestor_path)SVN::Fs::open($path, $config)SVN::Fs::path($fs)SVN::Fs::print_modules($s)β TODO alert π¨ literally doesn't work. it segfaults if$sis null, and if it's an empty string it justβ¦ does nothing. iconic behaviour honestly πSVN::Fs::props_changed($root1, $path1, $root2, $path2)β also peep"SVN::Fs::contents_changed"for the sibling energy πSVN::Fs::purge_txn($fs, $txn_id)β cleans up the transaction$txn_id, removing it completely from the filesystem$fs. gone. deleted. no trace π§ΉSVN::Fs::set_warning_func($fs, $code, $baton)SVN::Fs::unparse_id($id)β returns a string holding the unparsed form of the node or node revision id$id, and$idhas to be a_p_svn_fs_id_tobject. TODO: why is this not just a method on that object?? make it make sense π€SVN::Fs::version()β TODO: what are we even supposed to do with the_p_svn_version_tvalue it hands back?? no clue bestie πSVN::Fs::create_access($username)β returns a brand new_p_svn_fs_access_tobject representing$username.$usernameis presumed to have already been authenticated by whoever called you. so like, trust the caller, ok? π
π _p_svn_fs_t π
this is the filesystem object itself, the main character of the whole page:
$fs->begin_txn($rev)β creates a new transaction in the repository and returns a_p_svn_fs_txn_tobject for it. the new transaction's base revision is$rev, which should be a number. π’$fs->change_rev_prop$fs->generate_lock_token()β generates a unique lock-token using$fs. TODO: this needs translating to apply to Perl β apparently it can be used to populatelock->tokenbefore callingsvn_fs_attach_lock(). π$fs->get_access()β the filesystem's current access context, as a_p_svn_fs_access_tobject. returnsundefif no access context has been set with theset_access()method. π$fs->get_lock$fs->get_locks$fs->get_uuid()β the UUID associated with$fs. π$fs->list_transactions()β a reference to an array of all currently active transactions in the filesystem. each one is a string with the transaction's ID, and you can pass it straight to"$fs->open_txn()". so convenient π$fs->lock$fs->open_txn($name)β gets a transaction in the repository by name. returns a_p_svn_fs_txn_tobject. π$fs->revision_prop($rev, $propname)β the value of revision property$propnamein revision$rev.$fs->revision_proplist($rev)β a hashref with the names and values of all the revision properties from revision$rev. all of them. every last one. β¨$fs->revision_root$fs->set_access($access)β associates an access context with an open filesystem. you can run this method multiple times on the same open filesystem to swap the access context for different operations.$accessshould be a_p_svn_fs_access_tobject, orundefto disassociate the current access context from the filesystem. π$fs->set_uuid($uuid)β associates$uuidwith$fs.$fs->unlock$fs->youngest_rev()β returns the number of the youngest revision in the filesystem. and fun fact: the oldest revision in any filesystem is numbered zero. periodt. 0οΈβ£
π¦ _p_svn_fs_root_t π¦
roots, roots, roots β here's the whole list:
$root->apply_text$root->apply_textdelta$root->change_node_prop($path, $propname, $value)$root->check_path($path)β what kind of node is at$path. returns a number matching one of these constants:$SVN::Node::none,$SVN::Node::file,$SVN::Node::dir,$SVN::Node::unknown. π$root->close_root$root->closest_copy$root->copied_from$root->copy$root->delete$root->dir_entries$root->file_contents$root->file_length$root->file_md5_checksum$root->fs()β the filesystem$rootbelongs to, as a_p_svn_fs_tobject. π$root->is_dir($path)β true if there's a node at$pathand it's a directory. π$root->is_file($path)β true if there's a node at$pathand it's a file. π$root->is_revision_root()β true if the root comes from a revision, meaning the contents have already been committed. πΎ$root->is_txn_root()β true if the root comes from a transaction. π§Ύ$root->make_dir$root->make_file$root->node_created_path($path)$root->node_created_rev($path)$root->node_history($path)β TODO:_p_svn_fs_history_tπ$root->node_id($path)$root->node_prop($path, $propname)$root->node_proplist($path)$root->paths_changed()β a reference to a hash showing what changes were made in the root. the keys are the paths of the changed files, starting with/to mean the top-level directory of the repository. the values are_p_svn_fs_path_change_tobjects holding info about what kind of changes went down. π$root->revision_link$root->revision_root_revisionβ the revision number of the revision the root comes from. but for transaction roots? it returns$SVN::Core::INVALID_REVNUM. π
π« _p_svn_fs_history_t π«
$history->location()β in list context, a list of two items: the path to the node whose history this is, and the revision number in which it exists. in scalar context it gives you just the revision number. pick your fighter π$history->prev($cross_copies)
π _p_svn_fs_txn_t π
transactions, babes:
$txn->abort()β aborts the transaction. any changes made in$txnget discarded and the filesystem is left unchanged. poof. π¨
note bestie: this function first sets the state of$txnto'dead', and then tries to purge it and any related data from the filesystem. if some part of the cleanup process fails,$txnand some portion of its data may still be hanging around in the database after this function returns. use"$fs->purge_txn()"to retry the transaction cleanup. don't say I didn't warn you π
$txn->base_revision()β the transaction's base revision number.$txn->change_prop($name, $value)β adds, changes, or removes a property from the transaction. if$valueis"undef"then the property$nameis removed (if it exists). otherwise the property$nameis set to the new value. π§$txn->commit$txn->name()β the full name of the revision, in the same format you can pass to"$fs->open_txn()". π·οΈ$txn->prop($name)β the value of the transaction's$nameproperty.$txn->proplist()β a reference to a hash with all the transaction's properties, keyed by name. β¨$txn->root()β the root directory of the transaction, as a_p_svn_fs_root_tobject. π³
π§ _p_svn_fs_access_t π§
π SYNOPSIS
my $access = SVN::Fs::create_access($username);
my $access = $fs->get_access;
$fs->set_access($access);
my $username = $access->get_username;
$access->add_lock_token($token);
π METHODS
$access->add_lock_token($token)β pushes a lock-token into the access context. the context remembers every token it receives and makes them available to fs functions. a little collector, honestly π$access->get_usernameβ the username represented by the access context. π
π svn_fs_dirent_t π
an object representing a directory entry. values of this type come back as the values in the hash returned by "$root->dir_entries()". they're like svn_dirent_t objects but with less info β diet dirent energy π₯€
$dirent->id()β TODO π$dirent->kind()β node kind. a number matching one of these constants:$SVN::Node::none,$SVN::Node::file,$SVN::Node::dir,$SVN::Node::unknown.$dirent->name()β the filename of the directory entry. π
π _p_svn_fs_path_change_t π
$change->change_kind()β the type of change made. a number matching one of these:$SVN::Fs::PathChange::modifyβ content at path modified. βοΈ$SVN::Fs::PathChange::addβ path added in transaction. β$SVN::Fs::PathChange::deleteβ path removed in transaction. β$SVN::Fs::PathChange::replaceβ path removed and re-added in transaction. π$SVN::Fs::PathChange::resetβ ignore all previous change items for the path (internal-use only). π«
$change->node_rev_id()β node revision id of the changed path. a_p_svn_fs_id_tobject. π$change->prop_mod()β true if the properties were modified. π·οΈ$change->text_mod()β true if the text (content) was modified. π
π 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.
and that's the whole page, bestie π«Ά this one came from perl v5.42.3, dated 2026-10-16, and it's the native::Fs(3) manual β go forth and slay your filesystem operations π β¨π
π¦ where this page comes from
- fedora 43: subversion-perl 1.15.0-2.fc43 Β· Apache-2.0
- fedora 43: subversion-perl 1.15.0-2.fc43 Β· Apache-2.0
- fedora 44: subversion-perl 1.15.0-2.fc44 Β· Apache-2.0
- fedora 44: subversion-perl 1.15.0-2.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms