SVN::Class::Info - Subversion workspace info


SVN-Class documentation Contained in the SVN-Class distribution.

Index


Code Index:

NAME

Top

SVN::Class::Info - Subversion workspace info

SYNOPSIS

Top

 use SVN::Class;

 my $file = svn_file( 'path/to/file' );
 my $info = $file->info;
 printf "repository URL = %s\n", $info->url;

DESCRIPTION

Top

SVN::Class::Info represents the output of the svn info command.

METHODS

Top

SVN::Class::Info does not inherit from SVN::Class, but only Class::Accessor::Fast.

new( $dir->stdout )

Creates new SVN::Class::Info instance. The lone argument should be an array ref of output from a call to the SVN::Class object's info() method.

You normally do not need to use this method directly. See the SVN::Class info() method.

dump

Returns dump() of the object, just like SVN::Class->dump().

url

Get the URL value. Returns a SVN::Class::Repos object.

path

name

root

rev

node

schedule

author

last_rev

date

updated

checksum

uuid

Get/set the info params. These are really only useful as accessors (getters).

AUTHOR

Top

Peter Karman, <karman at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-svn-class at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVN-Class. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc SVN::Class

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/SVN-Class

* CPAN Ratings

http://cpanratings.perl.org/d/SVN-Class

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=SVN-Class

* Search CPAN

http://search.cpan.org/dist/SVN-Class

ACKNOWLEDGEMENTS

Top

I looked at SVN::Agent before starting this project. It has a different API, more like SVN::Client in the SVN::Core, but I cribbed some of the ideas.

The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.

COPYRIGHT

Top

SEE ALSO

Top

Path::Class, Class::Accessor::Fast, SVN::Agent, IPC::Cmd


SVN-Class documentation Contained in the SVN-Class distribution.
package SVN::Class::Info;
use strict;
use warnings;
use base qw( Rose::Object );
use Rose::Object::MakeMethods::Generic (
    scalar => [
        qw( path name _url root rev
            node schedule author last_rev date
            updated checksum uuid
            )
    ]
);
use Carp;
use Data::Dump;
use SVN::Class::Repos;

our $VERSION = '0.16';

sub new {
    my $class = shift;
    my $buf   = shift;
    if ( !$buf or !ref($buf) or ref($buf) ne 'ARRAY' ) {
        croak "need array ref of 'svn info' output";
    }
    return $class->SUPER::new( _make_hash(@$buf) );
}

sub dump {
    return Data::Dump::dump(@_);
}

my %fieldmap = (
    Path                  => 'path',
    Name                  => 'name',
    URL                   => '_url',
    'Repository Root'     => 'root',
    'Repository UUID'     => 'uuid',
    'Revision'            => 'rev',
    'Node Kind'           => 'node',
    'Schedule'            => 'schedule',
    'Last Changed Author' => 'author',
    'Last Changed Rev'    => 'last_rev',
    'Last Changed Date'   => 'date',
    'Text Last Updated'   => 'updated',
    'Checksum'            => 'checksum'
);

sub _make_hash {
    my %hash;
    for (@_) {
        my ( $field, $value ) = (m/^([^:]+):\ (.+)$/);
        if ( !exists $fieldmap{$field} ) {
            croak "unknown field name in svn info: $field";
        }
        $hash{ $fieldmap{$field} } = $value;
    }
    return %hash;
}

sub url {
    my $self = shift;
    return SVN::Class::Repos->new( $self->_url );
}

1;

__END__