root/lang/perl/Archer/lib/Archer/Plugin/SVN/Diff.pm @ 3685

Revision 3685, 0.9 kB (checked in by tokuhirom, 5 years ago)

r3617@mnk (orig r267): tokuhiro | 2007-02-14 23:17:42 -0800
remove unused require.


Line 
1package Archer::Plugin::SVN::Diff;
2
3use strict;
4use warnings;
5use base qw( Archer::Plugin::SVN );
6use SVN::Agent;
7
8sub run {
9    my ($self, $context, $args) = @_;
10
11    $ENV{LANG} = 'C';
12
13    my $path = $self->{config}->{path}
14        || File::Spec->catfile($context->{config}->{global}->{work_dir}, $context->{project});
15    $path = $self->templatize($path);
16
17    my $rev = `svn info $path`;
18    $rev = $1 if $rev =~ /Revision: (\d+)/;
19
20    my $svn = SVN::Agent->load({ path => $path });
21    print eval { $svn->diff("-r$rev:HEAD") };
22}
23
241;
25__END__
26
27=head1 NAME
28
29Archer::Plugin::SVN::Diff - svn diff
30
31=head1 SYNOPSIS
32
33  - module: SVN::Diff
34    config:
35      path: "[% work_dir %]/[% project %]"
36
37=head1 DESCRIPTION
38
39Execute svn diff.
40
41=head1 CONFIG
42
43=head2 path
44
45Svn working directory path.Default is [% work_dir %]/[% project %].
46
47=head1 AUTHORS
48
49Gosuke Miyashita
50
51=head1 SEE ALSO
52
53L<SVN::Agent>
54
55=cut
Note: See TracBrowser for help on using the browser.