|
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 | |
|---|
| 1 | package Archer::Plugin::SVN::Diff; |
|---|
| 2 | |
|---|
| 3 | use strict; |
|---|
| 4 | use warnings; |
|---|
| 5 | use base qw( Archer::Plugin::SVN ); |
|---|
| 6 | use SVN::Agent; |
|---|
| 7 | |
|---|
| 8 | sub 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 | |
|---|
| 24 | 1; |
|---|
| 25 | __END__ |
|---|
| 26 | |
|---|
| 27 | =head1 NAME |
|---|
| 28 | |
|---|
| 29 | Archer::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 | |
|---|
| 39 | Execute svn diff. |
|---|
| 40 | |
|---|
| 41 | =head1 CONFIG |
|---|
| 42 | |
|---|
| 43 | =head2 path |
|---|
| 44 | |
|---|
| 45 | Svn working directory path.Default is [% work_dir %]/[% project %]. |
|---|
| 46 | |
|---|
| 47 | =head1 AUTHORS |
|---|
| 48 | |
|---|
| 49 | Gosuke Miyashita |
|---|
| 50 | |
|---|
| 51 | =head1 SEE ALSO |
|---|
| 52 | |
|---|
| 53 | L<SVN::Agent> |
|---|
| 54 | |
|---|
| 55 | =cut |
|---|