line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VCS::Hms::Version; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
@ISA = qw(VCS::Hms); |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
my $DIFF_CMD = "fdiff "; |
6
|
|
|
|
|
|
|
my $UPDATE_CMD = "fco -p"; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
0
|
|
my ($class, $name, $version) = @_; |
10
|
0
|
0
|
|
|
|
|
return unless -f $name; |
11
|
0
|
|
|
|
|
|
my $self = { |
12
|
|
|
|
|
|
|
NAME => $name, |
13
|
|
|
|
|
|
|
VERSION => $version, |
14
|
|
|
|
|
|
|
}; |
15
|
0
|
|
|
|
|
|
bless $self, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub name { |
19
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
20
|
0
|
|
|
|
|
|
$self->{NAME}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub version { |
24
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
25
|
0
|
|
|
|
|
|
$self->{VERSION}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub tags { |
29
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
my ($header, $log) = $self->_split_log($self->{VERSION}); |
31
|
0
|
|
|
|
|
|
my $header_info = $self->_parse_log_header($header); |
32
|
0
|
|
|
|
|
|
my %rev2tags; |
33
|
0
|
|
|
|
|
|
my $tag_text = $header_info->{'symbolic names'}; |
34
|
|
|
|
|
|
|
#warn "t_t: $tag_text\n"; |
35
|
0
|
|
|
|
|
|
$tag_text =~ s#^\s+##gm; |
36
|
|
|
|
|
|
|
#warn "t_t2: $tag_text\n"; |
37
|
|
|
|
|
|
|
# return () unless defined ($rev2tags{$self->{VERSION}}); |
38
|
0
|
|
|
|
|
|
map { |
39
|
0
|
|
|
|
|
|
my ($tag, $rev) = split /:\s*/; |
40
|
0
|
|
|
|
|
|
push @{$rev2tags{$rev}}, $tag; |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} split /\n/, $tag_text; |
42
|
0
|
0
|
|
|
|
|
@{ $rev2tags{$self->{VERSION}} || [] }; |
|
0
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub text { |
46
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
$self->_read_pipe( |
48
|
|
|
|
|
|
|
"$UPDATE_CMD -r$self->{VERSION} $self->{NAME} 2>/dev/null |" |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub diff { |
53
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
54
|
0
|
|
|
|
|
|
my $other = shift; |
55
|
|
|
|
|
|
|
#print "$self -> $other\n"; |
56
|
0
|
|
|
|
|
|
my $text = ''; |
57
|
0
|
0
|
|
|
|
|
if (ref($other) eq ref($self)) { |
58
|
0
|
|
|
|
|
|
my $cmd = join ' ', |
59
|
|
|
|
|
|
|
$DIFF_CMD, |
60
|
0
|
|
|
|
|
|
(map { "-r$_" } $self->version, $other->version), |
61
|
|
|
|
|
|
|
$self->name, |
62
|
|
|
|
|
|
|
' 2>&1 |'; |
63
|
0
|
|
|
|
|
|
$text = $self->_read_pipe($cmd); |
64
|
|
|
|
|
|
|
#$text =~ s#.*^diff.*?\n##ms; |
65
|
|
|
|
|
|
|
#print "cmd: $cmd gave $text\n"; |
66
|
|
|
|
|
|
|
} |
67
|
0
|
|
|
|
|
|
$text; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub author { |
71
|
0
|
|
|
0
|
0
|
|
shift->_boiler_plate_info('author'); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub date { |
75
|
0
|
|
|
0
|
0
|
|
shift->_boiler_plate_info('date'); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub reason { |
79
|
0
|
|
|
0
|
0
|
|
join "\n", @{shift->_boiler_plate_info('reason')}; |
|
0
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |