SVN::Look(3pm)

πŸ“¦
version 0.43 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… SVN::Look β€” the Perl module bestie πŸ’…

aka SVN::Look from the User Contributed Perl Documentation corner of the perl-verse, version 0.43 ✨


🌸 NAME 🌸

SVN::Look β€” it's a caching wrapper around the svnlook command, no cap 🫢


✨ VERSION ✨

version 0.43 β€” yes bestie, that's the one, that's the vibe πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

use SVN::Look;
my $revlook = SVN::Look->new('/repo/path', -r => 123);
my $author  = $revlook->author();
my $msg     = $revlook->log_msg();
my @added_files   = $revlook->added();
my @updated_files = $revlook->updated();
my @deleted_files = $revlook->deleted();
my @changed_files = $revlook->changed();
my $file_contents = $revlook->cat('/path/to/file/in/repository');

my $trxlook = SVN::Look->new('/repo/path', -t => 123);

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so picture this: svnlook is literally the main character of Subversion hook scripts. It's the workhorse 🐴 that gathers all the info about a repository, its revisions, and its transactions. And this module? It gives you a simple object-oriented interface to one specific svnlook invocation, so hook writers can just... get their info and go. Slay.

And the best part? everything gathered by calling the svnlook command is cached in the object, so you're not out here making repetitious calls like a clown πŸ’€ Efficiency ate, periodt.


πŸŽ€ METHODS πŸŽ€

πŸ“ new REPO [, WHAT, NUMBER]

The SVN::Look constructor. It needs either one argument or three, bestie, no in-between:

  • REPO β€” the path to the repository πŸ—‚οΈ
  • WHAT β€” must be either '-r' or '-t', telling us whether the third argument is a revision number or a transaction number, respectively. And if neither -r nor -t is specified? You get the HEAD revision. Default behaviour, iconic.
  • NUMBER β€” either a revision or transaction NUMBER, as specified by WHAT.

πŸ’œ repo

Returns the repository path that was passed to the constructor. Simple. Clean. We love her.

🌈 txn

Returns the transaction number that was passed to the constructor. If none was passed, returns undef. Not me being optional πŸ™ˆ

⭐ rev

Returns the revision number that was passed to the constructor. If none was passed, returns undef.

🌸 author

Returns the author of the revision/transaction. Credit where credit is due, bestie πŸ‘‘

πŸ¦‹ cat PATH

Returns the contents of the file at PATH. In scalar context, you get the whole contents in a single string. In list context? A list of chomped lines. Context matters, iykyk.

πŸŽ€ changed_hash

Returns a reference to a hash containing information about all file changes that occurred in the revision. The hash always has the following keys:

  • added β€” a list of files added in the revision.
  • deleted β€” a list of files deleted in the revision.
  • updated β€” a list of files updated in the revision.
  • prop_modified β€” a list of files that had properties modified in the revision.
  • copied β€” a hash containing information about each file or directory copied in the revision. The hash keys are the names of elements copied to. The value associated with a key is a two-element array containing the name of the element copied from and the specific revision from which it was copied. Nested hash realness πŸ’…

πŸ”₯ added

Returns the list of files added in the revision/transaction.

πŸ”₯ updated

Returns the list of files updated in the revision/transaction.

πŸ”₯ deleted

Returns the list of files deleted in the revision/transaction.

πŸ”₯ prop_modified

Returns the list of files that had properties modified in the revision/transaction.

✨ changed

Returns the list of all files added, updated, deleted, and the ones that had properties modified in the revision/transaction. The whole roster, fr fr.

πŸ’– copied_to

Returns the list of new names of files that were copied in the revision/transaction.

πŸ’– copied_from

Returns the list of original names of files that were copied in the revision/transaction. And the order of this list is guaranteed to agree with the order generated by the method copied_to β€” they're matching besties, they walk in together 🫢

🌟 date

Returns the date of the revision/transaction.

πŸ’… diff [OPTS, ...]

Returns the GNU-style diffs of changed files and properties. There are three optional options you can pass as strings:

  • "--no-diff-deleted" β€” do not print differences for deleted files.
  • "--no-diff-added" β€” do not print differences for added files.
  • "--diff-copy-from" β€” print differences against the copy source.

In scalar context, you get the whole diff in a single string. In list context, you get a list of chomped lines. Same energy as cat, different content πŸ’«

🧚 dirs_changed

Returns the list of directories changed in the revision/transaction.

πŸ“ filesize PATH

Returns the size (in bytes) of the file located at PATH as it is represented in the repository. Numbers don't lie, bestie.

🌈 info

Returns the author, datestamp, log message size, and log message of the revision/transaction. The whole info dump, all in one, we love a bundle πŸ’

πŸ”’ lock PATH

If PATH has a lock, returns a hash containing information about the lock, with the following keys:

  • UUID Token β€” a string with the opaque lock token.
  • Owner β€” the name of the user that has the lock.
  • Created β€” the time at which the lock was created, in a format like this: '2010-02-16 17:23:08 -0200 (Tue, 16 Feb 2010)'.
  • Comment β€” the lock comment.

If PATH has no lock, returns undef. Nothing to see here πŸ™ˆ

πŸ’Œ log_msg

Returns the log message of the revision/transaction.

🎁 propget PROPNAME PATH

Returns the value of PROPNAME in PATH.

🎁 proplist PATH

Returns a reference to a hash containing the properties associated with PATH.

🌳 tree [PATH_IN_REPOS, OPTS, ...]

Returns the repository tree as a list of paths, starting at PATH_IN_REPOS (if it's supplied β€” otherwise it starts at the root of the tree), and optionally showing node revision ids. Options:

  • "--full-paths" β€” show full paths instead of indenting them.
  • "--show-ids" β€” returns the node revision ids for each path.
  • "--non-recursive" β€” operate on single directory only.

πŸ‘‘ uuid

Returns the repository's UUID.

🌟 youngest

Returns the repository's youngest revision number. Baby of the family, literally 🍼


🏠 REPOSITORY 🏠

<https://github.com/gnustavo/SVN-Look> β€” come hang out, the source is right there πŸ’–


✍️ AUTHOR ✍️

Gustavo L. de M. Chaves <gnustavo@cpan.org> β€” the icon, the legend πŸ‘‘


This software is copyright (c) 2022 by CPqD.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free as in bestie, fr fr πŸ•ŠοΈ


okay that's the whole page, you're welcome πŸ’… this was documented by perl v5.34.0 back on 2022-05-23, and honestly it still serves. go read the source, mwah 🫢✨

πŸ“¦ where this page comes from