root/library/perl/trunk/Archer/lib/Archer/Plugin/SVN/Log.pm

Revision 361, 0.9 kB (checked in by miya, 4 years ago)

Rsync: Change config format in yaml.
SVN::*: change variable name of SVN::Agent object.

Archer::Plugin: Fix to set dest_dir in templatize.

Line 
1 package Archer::Plugin::SVN::Log;
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 + 1 if $rev =~ /Revision: (\d+)/;
19
20     my $svn = SVN::Agent->load({ path => $path });
21     print $svn->log('-v', "-r$rev:HEAD");
22 }
23
24 1;
25 __END__
26
27 =head1 NAME
28
29 Archer::Plugin::SVN::Log - svn log
30
31 =head1 SYNOPSIS
32
33   - module: SVN::Log
34     config:
35       path: "[% work_dir %]/[% project %]"
36
37 =head1 DESCRIPTION
38
39 Execute svn log.
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
56
Note: See TracBrowser for help on using the browser.