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 $s is 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 $id has to be a _p_svn_fs_id_t object. 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_t value it hands back?? no clue bestie πŸ™ˆ
  • SVN::Fs::create_access($username) β€” returns a brand new _p_svn_fs_access_t object representing $username. $username is 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_t object 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 populate lock->token before calling svn_fs_attach_lock(). πŸ“
  • $fs->get_access() β€” the filesystem's current access context, as a _p_svn_fs_access_t object. returns undef if no access context has been set with the set_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_t object. πŸŽ€
  • $fs->revision_prop($rev, $propname) β€” the value of revision property $propname in 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. $access should be a _p_svn_fs_access_t object, or undef to disassociate the current access context from the filesystem. πŸ”„
  • $fs->set_uuid($uuid) β€” associates $uuid with $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 $root belongs to, as a _p_svn_fs_t object. πŸ’œ
  • $root->is_dir($path) β€” true if there's a node at $path and it's a directory. πŸ“
  • $root->is_file($path) β€” true if there's a node at $path and 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_t objects 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 $txn get discarded and the filesystem is left unchanged. poof. πŸ’¨
note bestie: this function first sets the state of $txn to 'dead', and then tries to purge it and any related data from the filesystem. if some part of the cleanup process fails, $txn and 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 $value is "undef" then the property $name is removed (if it exists). otherwise the property $name is 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 $name property.
  • $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_t object. 🌳

🧚 _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_t object. πŸ†”
  • $change->prop_mod() β€” true if the properties were modified. 🏷️
  • $change->text_mod() β€” true if the text (content) was modified. πŸ“

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