| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package VCS::Hms; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
31295
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
41
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
55
|
|
|
5
|
1
|
|
|
1
|
|
495
|
use VCS::Hms::Dir; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
38
|
|
|
6
|
1
|
|
|
1
|
|
674
|
use VCS::Hms::File; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
31
|
|
|
7
|
1
|
|
|
1
|
|
1408
|
use VCS::Hms::Version; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
865
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.04'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $LOG_CMD = "fhist"; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my %LOG_CACHE; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _boiler_plate_info { |
|
16
|
0
|
|
|
0
|
|
|
my ($self, $what) = @_; |
|
17
|
0
|
|
|
|
|
|
my ($header, $log) = $self->_split_log($self->version); |
|
18
|
0
|
|
|
|
|
|
my $rev_info = $self->_parse_log_rev($log); |
|
19
|
0
|
|
|
|
|
|
$rev_info->{$what}; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _split_log { |
|
23
|
0
|
|
|
0
|
|
|
my ($self, $version) = @_; |
|
24
|
0
|
|
|
|
|
|
my $log_text; |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
my $cache_id = $self->path . '/' . defined $version ? $version : 'all'; |
|
27
|
0
|
0
|
|
|
|
|
unless (defined($log_text = $LOG_CACHE{$cache_id})) { |
|
28
|
0
|
0
|
|
|
|
|
my $cmd = |
|
29
|
|
|
|
|
|
|
$LOG_CMD . |
|
30
|
|
|
|
|
|
|
(defined $version ? " -r$version" : '') . |
|
31
|
|
|
|
|
|
|
" " . $self->path . " |"; |
|
32
|
0
|
|
|
|
|
|
$LOG_CACHE{$cache_id} = $log_text = $self->_read_pipe($cmd); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
0
|
|
|
|
|
|
my @sections = split /\n[=\-]+\n/, $log_text; |
|
35
|
|
|
|
|
|
|
#map { print "SEC: $_\n" } @sections; |
|
36
|
0
|
|
|
|
|
|
@sections; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _parse_log_rev { |
|
40
|
0
|
|
|
0
|
|
|
my ($self, $text) = @_; |
|
41
|
0
|
|
|
|
|
|
my ($rev_line, $blurb, $blurb2, @reason) = split /\n/, $text; |
|
42
|
0
|
|
|
|
|
|
my %info = map { |
|
43
|
0
|
|
|
|
|
|
split /:\s+/,2 |
|
44
|
|
|
|
|
|
|
} split /;\s*/, $blurb.$blurb2,; |
|
45
|
0
|
|
|
|
|
|
my ($junk, $rev) = split /\s+/, $rev_line; |
|
46
|
0
|
|
|
|
|
|
$info{'revision'} = $rev; |
|
47
|
0
|
|
|
|
|
|
$info{'reason'} = \@reason; |
|
48
|
|
|
|
|
|
|
#print "REASON: @reason\n"; |
|
49
|
|
|
|
|
|
|
#map { print "$_ => $info{$_}\n" } keys %info; |
|
50
|
0
|
|
|
|
|
|
\%info; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _parse_log_header { |
|
54
|
0
|
|
|
0
|
|
|
my ($self, $text) = @_; |
|
55
|
0
|
|
|
|
|
|
my @parts = $text =~ /^(\S.*?)(?=^\S|\Z)/gms; |
|
56
|
0
|
|
|
|
|
|
chomp @parts; |
|
57
|
|
|
|
|
|
|
#map { print "PART: $_\n" } @parts; |
|
58
|
0
|
|
|
|
|
|
my %info = map { |
|
59
|
0
|
|
|
|
|
|
split /:\s*/, $_, 2 |
|
60
|
|
|
|
|
|
|
} @parts; |
|
61
|
|
|
|
|
|
|
#map { print "$_ => $info{$_}\n" } keys %info; |
|
62
|
0
|
|
|
|
|
|
\%info; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub _read_pipe { |
|
66
|
0
|
|
|
0
|
|
|
my ($self, $cmd) = @_; |
|
67
|
0
|
|
|
|
|
|
local *PIPE; |
|
68
|
|
|
|
|
|
|
#print "Pipe : $cmd\n"; |
|
69
|
0
|
|
|
|
|
|
open PIPE, $cmd; |
|
70
|
0
|
|
|
|
|
|
local $/ = undef; |
|
71
|
0
|
|
|
|
|
|
my $contents = ; |
|
72
|
0
|
|
|
|
|
|
close PIPE; |
|
73
|
0
|
|
|
|
|
|
return $contents; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 NAME |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
VCS::Hms - notes for the HMS implementation |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 IMPORTANT NOTE |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
I have no way to test this module and so I have removed it out of |
|
85
|
|
|
|
|
|
|
the main VCS distribution. If you have access to Hms and would like |
|
86
|
|
|
|
|
|
|
to maintain this module please contact me - greg@mccarroll.org.uk. |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
use VCS; |
|
92
|
|
|
|
|
|
|
$file = VCS::File->new('Makefile'); |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Currently, the user needs to ensure that their environment has the |
|
97
|
|
|
|
|
|
|
HMS toolset available, including B, B, B, et al. |
|
98
|
|
|
|
|
|
|
On Unix like environments ensure that the C<$PATH> environment variable |
|
99
|
|
|
|
|
|
|
has the appropriate directory listed. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Copyright (c) 2003-2008 Greg McCarroll. |
|
104
|
|
|
|
|
|
|
Copyright (c) 1998-2001 Leon Brocard. |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
All rights reserved. This program is free software; you can |
|
107
|
|
|
|
|
|
|
redistribute it and/or modify it under the same terms as Perl itself. |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
L. |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |