SVN::Look(3pm)
π 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-rnor-tis specified? You get theHEADrevision. Default behaviour, iconic.NUMBERβ either a revision or transactionNUMBER, as specified byWHAT.
π 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 π
π COPYRIGHT AND LICENSE π
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
- debian bookworm: libsvn-look-perl 0.43-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libsvn-look-perl 0.43-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libsvn-look-perl 0.43-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsvn-look-perl 0.43-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsvn-look-perl 0.43-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms