Skip to content

Commit ecfe22c

Browse files
committed
Report timestamp error at most once per file.
Signed-off-by: Henry Cox <[email protected]>
1 parent 8250550 commit ecfe22c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

bin/genhtml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4470,6 +4470,8 @@ sub nextBranchInOwnerBin
44704470
return undef;
44714471
}
44724472

4473+
my %annotateWarnings; # warn only once per file
4474+
44734475
sub _computeAge
44744476
{
44754477
my ($when, $path) = @_;
@@ -4484,12 +4486,17 @@ sub _computeAge
44844486
DateTime->now();
44854487
my $then = lcovutil::parse_w3cdtf($when);
44864488
if ($then > $now) {
4487-
my $data =
4488-
exists($ENV{SOURCE_DATE_EPOCH}) ?
4489-
"'SOURCE_DATE_EPOCH=$ENV{SOURCE_DATE_EPOCH}'" :
4490-
"'now'";
4491-
lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA,
4492-
"File \"$path\": $data ($now) is older than annotate time '$when'");
4489+
unless (exists($annotateWarnings{$path})) {
4490+
# issue annotation warning at most once per file
4491+
my $data =
4492+
exists($ENV{SOURCE_DATE_EPOCH}) ?
4493+
"'SOURCE_DATE_EPOCH=$ENV{SOURCE_DATE_EPOCH}'" :
4494+
"'now'";
4495+
$annotateWarnings{$path} = $now;
4496+
lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA,
4497+
"File \"$path\": $data ($now) is older than annotate time '$when'"
4498+
);
4499+
}
44934500
return 0;
44944501
}
44954502
return $then->delta_days($now)->in_units('days');

tests/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ TESTS := genhtml lcov gendiffcov py2lcov perl2lcov
1717
# there may or may not be some .info files generated for exported
1818
# tools - py2lcov, perl2lcov, etc. We want them included in the
1919
# report - but they might not have been generated, so we need to
20-
# ignore the potential 'empty glob pattern' error message
20+
# ignore the potential 'empty glob pattern' error message and a
21+
# potential remote repo timestamp issue
2122
report:
2223
if [ "x$(COVERAGE)" != 'x' ] ; then \
2324
cover ; \

0 commit comments

Comments
 (0)