change rcs_recentchanges when to absolute, not relative, time
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 29 Jan 2008 03:57:22 +0000 (22:57 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 29 Jan 2008 03:57:22 +0000 (22:57 -0500)
No point in using a relative time value in rcs_recentchanges. Different
consumers of the info want different things.

IkiWiki/CGI.pm
IkiWiki/Rcs/git.pm
IkiWiki/Rcs/mercurial.pm
IkiWiki/Rcs/monotone.pm
IkiWiki/Rcs/svn.pm
IkiWiki/Rcs/tla.pm

index 65a1d7fa08c00c36c08cbda7ec0e82b5f323222e..03c448923c1d699f80e41dd2aa8fa5d90729e738 100644 (file)
@@ -100,7 +100,7 @@ sub cgi_recentchanges ($) { #{{{
 
        my $changelog=[rcs_recentchanges(100)];
        foreach my $change (@$changelog) {
-               $change->{when} = concise(ago($change->{when}));
+               $change->{when} = concise(ago(time - $change->{when}));
 
                $change->{user} = userlink($change->{user});
 
index 271104f3e624059b131046ad02db1059efd91b9c..f70582136569b270d57c27591e961a6f1216c142 100644 (file)
@@ -372,7 +372,7 @@ sub rcs_recentchanges ($) { #{{{
 
                my ($sha1, $when) = (
                        $ci->{'sha1'},
-                       time - $ci->{'author_epoch'}
+                       $ci->{'author_epoch'}
                );
 
                my (@pages, @messages);
index 15edb324581dc33e912dc17f214117b419fa689f..13a88379c0fb2ae47ba6a4f7ebe5592c037a0484 100644 (file)
@@ -142,7 +142,7 @@ sub rcs_recentchanges ($) { #{{{
                        rev        => $info->{"changeset"},
                        user       => $user,
                        committype => "mercurial",
-                       when       => time - str2time($info->{"date"}),
+                       when       => str2time($info->{"date"}),
                        message    => [@message],
                        pages      => [@pages],
                };
index 5717e004342875e97259cc09fe22b77f7b981810..b48ac92dbfa22c6adc16cfee00c83aacceb8617b 100644 (file)
@@ -416,7 +416,7 @@ sub rcs_recentchanges ($) { #{{{
                                                $committype = "monotone";
                                        }
                                } elsif ($cert->{name} eq "date") {
-                                       $when = time - str2time($cert->{value}, 'UTC');
+                                       $when = str2time($cert->{value}, 'UTC');
                                } elsif ($cert->{name} eq "changelog") {
                                        my $messageText = $cert->{value};
                                        # split the changelog into multiple
index 002527bddddf4d3ff9610da0ee4910c5c0ac9cce..075f8da5a32daff4ed4794fccb0633115c32f603 100644 (file)
@@ -171,7 +171,7 @@ sub rcs_recentchanges ($) { #{{{
                my $rev = $logentry->{revision};
                my $user = $logentry->{author};
 
-               my $when=time - str2time($logentry->{date}, 'UTC');
+               my $when=str2time($logentry->{date}, 'UTC');
 
                foreach my $msgline (split(/\n/, $logentry->{msg})) {
                        push @message, { line => $msgline };
index ffb6ee521a34fe70c76b7ddf53f8df885d13b67e..15824ffaf71a6e465da23375c699323b819bf58a 100644 (file)
@@ -120,7 +120,7 @@ sub rcs_recentchanges ($) {
                        split(/ /, "$newfiles $modfiles .arch-ids/fake.id");
 
                my $sdate = $head->get("Standard-date");
-               my $when = time - str2time($sdate, 'UTC');
+               my $when = str2time($sdate, 'UTC');
 
                my $committype = "web";
                if (defined $summ && $summ =~ /$config{web_commit_regexp}/) {