Archer::Plugin::SVN::Diff - svn diff


Archer documentation Contained in the Archer distribution.

Index


Code Index:

NAME

Top

Archer::Plugin::SVN::Diff - svn diff

SYNOPSIS

Top

  - module: SVN::Diff
    config:
      path: "[% work_dir %]/[% project %]"

DESCRIPTION

Top

Execute svn diff.

CONFIG

Top

path

Svn working directory path.Default is [% work_dir %]/[% project %].

AUTHORS

Top

Gosuke Miyashita

SEE ALSO

Top

SVN::Agent


Archer documentation Contained in the Archer distribution.

package Archer::Plugin::SVN::Diff;

use strict;
use warnings;
use base qw( Archer::Plugin::SVN );
use SVN::Agent;

sub run {
    my ($self, $context, $args) = @_;

    $ENV{LANG} = 'C';

    my $path = $self->{config}->{path}
        || File::Spec->catfile($context->{config}->{global}->{work_dir}, $context->{project});
    $path = $self->templatize($path);

    my $rev = `svn info $path`;
    $rev = $1 if $rev =~ /Revision: (\d+)/;

    my $svn = SVN::Agent->load({ path => $path });
    print eval { $svn->diff("-r$rev:HEAD") };
}

1;
__END__