| 1 | package VCI::VCS::Hg::Committable; | ||||||||||
| 2 | 1 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use DateTime; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 0 | ▶ | sub _build_time { | ||||||||
|
Subroutine
_build_time: not called CC=2 SCAR=17.9
| |||||||||||
| 7 | 0 | my $self = shift; | |||||||||
| 8 | 0 | my $text = $self->project->x_get(['raw-rev', $self->revision]); | |||||||||
| 9 | 0 | $text =~ /^# Date (\d+) (-)?(\d+)$/ms; | |||||||||
| 10 | 0 | my ($time, $minus, $offset_seconds) = ($1, $2, $3); | |||||||||
| 11 | 0 | my $offset_hours = $offset_seconds / 3600; | |||||||||
| 12 | 0 | my $offset_fraction = $offset_hours - int($offset_hours); | |||||||||
| 13 | 0 | my $offset_minutes = $offset_fraction * 60; | |||||||||
| 14 | # Minus means plus, and absence of minus means...minus. | ||||||||||
| 15 | 0 | ▶ | my $direction = $minus ? '+' : '-'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | my $zone = $direction . sprintf('%02u%02u', $offset_hours, $offset_minutes); | |||||||||
| 17 | 0 | return DateTime->from_epoch(epoch => $time, time_zone => $zone); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 1 | 1; | |||||||||