SVN::D...:Record(3pm)

πŸ“¦
version 0.08 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– SVN::Dump::Record(3pm) β€” aka the glow-up of a Subversion dump record ✨

okay bestie, sit down, hydrate, and let me tell you about SVN::Dump::Record 🫢 it's a Perl module, it's version 0.08, and it's literally the main character of every Subversion dump record you will ever touch. no cap.


πŸ“œ SYNOPSIS

# SVN::Dump::Record objects are returned by the next_record()
# method of SVN::Dump

periodt. that's the whole vibe β€” you don't build these bad boys yourself, they get handed to you πŸ’…


🌸 DESCRIPTION

So a SVN::Dump::Record object? it represents a Subversion dump record. that's it, that's the girl. one object, one record, iconic behavior only πŸ‘‘


πŸŽ€ METHODS

SVN::Dump rolls up with the following groups of methods (the original says "gourps", which is honestly a typo with main character energy, we love her anyway 😭):

✨ Record methods

  • new() β€” makes you a brand new, completely empty SVN::Dump::Record object. blank slate, fresh start, self-care 🌱
  • type() β€” returns the record type, which it figures out by looking at the headers. if it can't work out the type, the method dies. rip, literally πŸ’€
  • set_header( $h, $v ) β€” sets header $h to the value $v.
  • get_header( $h ) β€” grabs the value of header $h.
  • set_property( $p, $v ) β€” sets property $p to the value $v.
  • get_property( $p ) β€” grabs the value of property $p.
  • delete_property( @k ) β€” deletes the properties named in @p. (yes, the docs say @p while the signature says @k, she's doing her best πŸ™ˆ) properties that aren't in the record just get silently ignored β€” no drama, we move on.
  • set_text( $t ) β€” sets the value of the text block.
  • get_text() β€” gets the value of the text block.

🧚 Inner blocks manipulation

A SVN::Dump::Record is composed of several inner blocks of various kinds: SVN::Dump::Headers, SVN::Dump::Property and SVN::Dump::Text. she's got layers, she's complex, she contains multitudes 🌈

The following methods give you access to these blocks:

  • set_headers_block( $headers ) and get_headers_block() β€” get or set the SVN::Dump::Headers object that represents the record headers.
  • set_property_block( $property ) and get_property_block() β€” get or set the SVN::Dump::Property object that represents the record property block.
  • delete_property( @keys ) β€” deletes the given properties. behaves exactly like the builtin delete(). bestie behavior: just like Perl's own 🫢
  • set_text_block( $text ) and get_text_block() β€” get or set the SVN::Dump::Text object that represents the record text block.
  • set_included_record( $record ) and get_included_record() β€” some special records are actually output recursively by svnadmin dump. the "record in the record" is stored inside the parent record, so they get parsed as a single record with an included record.

get_record() / set_record() give access to the included record.

According to the Subversion sources (subversion/libsvn_repos/dump.c), this is a "delete original, then add-with-history" node. the dump looks like this:

Node-path: tags/mytag/myfile
Node-kind: file
Node-action: delete

Node-path: tags/mytag/myfile
Node-kind: file
Node-action: add
Node-copyfrom-rev: 23
Node-copyfrom-path: trunk/myfile

and the way that there is a single blank line after the first header block, but four after the included one?? that's not a vibe, that's a lore drop 😭 count them. count them.

  • update_headers() β€” updates the various ...-length headers. used internally, lowkey undercover.
⚠️ you must call this method if you update the inner property or text blocks directly, or the results of as_string() will be inconsistent. so inconsistent. a mess. don't do it to yourself πŸ™ˆ

πŸ” Information methods

  • has_prop() β€” returns a boolean telling you if the record has a property block.
  • has_text() β€” returns a boolean telling you if the record has a text block.
  • has_prop_only() β€” returns a boolean telling you if the record has only a property block (and no text block). minimalism ✨
  • has_prop_or_text() β€” returns a boolean telling you if the record has a property block or a text block.
  • property_length() β€” returns the length of the property block.
  • text_length() β€” returns the length of the text block.

πŸ“€ Output method

  • as_string() β€” returns a string representation of the record that other Subversion tools, such as svnadmin, will actually understand. she speaks fluent svn πŸ—£οΈ
🚨 Warning: dumping a record currently returns the information that was read from the original dump. this means that if you modified the property or text block of a record, the headers will be inconsistent. ngl that's a whole problem, so be aware πŸ‘€

πŸ¦‹ ENCAPSULATION

When you're using SVN::Dump to manipulate a SVN dump, you should not go poking at the SVN::Dump::Headers, SVN::Dump::Property and SVN::Dump::Text components of a SVN::Dump::Record object directly. hands off the merch, bestie πŸ™…β€β™€οΈ use the appropriate set_...() and get_...() methods of the record object instead.

Why? because these methods compute the appropriate modifications of the header values, so that as_string() outputs the correct information after any modification of the record. that's the whole point. that's the slay. that's the iykyk πŸ’…


πŸ‘€ SEE ALSO

  • SVN::Dump
  • SVN::Dump::Reader
  • SVN::Dump::Headers
  • SVN::Dump::Property
  • SVN::Dump::Text

go read them, they're all in the group chat 🫢


Copyright 2006-2013 Philippe Bruhat (BooK), All Rights Reserved.

πŸ“„ LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie!! πŸŽ€ this was documented by the User Contributed Perl Documentation crew, on perl v5.36.0, dated 2022-10-14, and it lives in section 3pm as SVN::D...:Record(3pm) β€” the truncated name is giving "she doesn't fit in the header" energy but we stan a legend πŸ‘‘βœ¨ byeeee πŸ’–

πŸ“¦ where this page comes from