NAME
SVN::Look - A caching wrapper aroung the svnlook command.
VERSION
Version 0.19
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
The svnlook command is the workhorse of Subversion hook scripts, being used to gather all sorts of information about a repository, its revisions, and its transactions. This script provides a simple object oriented interface to a specific svnlook invocation, to make it easier to hook writers to get and use the information they need. Moreover, all the information gathered buy calling the svnlook command is cached in the object, avoiding repetitious calls.
METHODS
- new REPO, WHAT, NUMBER
-
The SVN::Look constructor needs three arguments:
- repo
-
Returns the repository path that was passed to the constructor.
- txn
-
Returns the transaction number that was passed to the constructor. If none was passed, returns undef.
- rev
-
Returns the revision number that was passed to the constructor. If none was passed, returns undef.
-
Returns the author of the revision/transaction.
- log_msg
-
Returns the log message of the revision/transaction.
- date
-
Returns the date of the revision/transaction.
- proplist PATH
-
Returns a reference to a hash containing the properties associated with PATH.
- changed_hash
-
Returns a reference to a hash containing information about all file changes occurred in the revision. The hash always has the following pairs:
- 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 mapping the old to the new name of each file moved in the revision.
- 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.
- dirs_changed
-
Returns the list of directories changed in the revision/transaction.
- copied_from
-
Returns the list of original names of files that were renamed in the revision/transaction.
- copied_to
-
Returns the list of new names of files that were renamed in the revision/transaction. The order of this list is guaranteed to agree with the order generated by the method copied_from.
- cat PATH
-
Returns the contents of the file at PATH. In scalar context, return the whole contents in a single string. In list context returns a list of chomped lines.
- diff [OPTS, ...]
-
Returns the GNU-style diffs of changed files and properties. There are three optional options that can be passed 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, return the whole diff in a single string. In list context returns a list of chomped lines.
- youngest
-
Returns the repository's youngest revision number.
- uuid
-
Returns the repository's UUID.
- 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.
- tree [PATH_IN_REPOS, OPTS, ...]
-
Returns the repository tree as a list of paths, starting at PATH_IN_REPOS (if supplied, at the root of the tree otherwise), optionally showing node revision ids.
AUTHOR
Gustavo Chaves, <gnustavo@cpan.org>
BUGS
Please report any bugs or feature requests to bug-svn-look at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVN-Hooks. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc SVN::Look
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
COPYRIGHT & LICENSE
Copyright 2008-2010 CPqD, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.