From patchwork Tue Nov 21 14:44:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: hgweb: show changeset age in more places (gitweb and monoblue) From: Anton Shestakov X-Patchwork-Id: 25713 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 21 Nov 2017 22:44:30 +0800 # HG changeset patch # User Anton Shestakov # Date 1511267337 -28800 # Tue Nov 21 20:28:57 2017 +0800 # Node ID e17143d2181bb77ef8346b7dfe32b894bbf9a064 # Parent f8e398c42760482f02e6cfb6b8a1e6a752564c95 # EXP-Topic hgweb-more-info hgweb: show changeset age in more places (gitweb and monoblue) mercurial.js has a process_dates() function that calculates relative age for a given date, it works for all elements with "age" css class. If those elements also have "date" css class, the original text is preserved and age is added at the end. This patch adds these two css classes in some pages in gitweb and monoblue that weren't already using this feature. diff --git a/mercurial/templates/gitweb/summary.tmpl b/mercurial/templates/gitweb/summary.tmpl --- a/mercurial/templates/gitweb/summary.tmpl +++ b/mercurial/templates/gitweb/summary.tmpl @@ -31,7 +31,7 @@ summary | - +
description{desc}
owner{owner|obfuscate}
last change{lastchange|rfc822date}
last change{lastchange|rfc822date}
changes
diff --git a/mercurial/templates/monoblue/changeset.tmpl b/mercurial/templates/monoblue/changeset.tmpl --- a/mercurial/templates/monoblue/changeset.tmpl +++ b/mercurial/templates/monoblue/changeset.tmpl @@ -44,7 +44,7 @@
author
{author|obfuscate}
date
-
{date|rfc822date}
+
{date|rfc822date}
{branch%changesetbranch}
changeset {rev}
{node|short}
diff --git a/mercurial/templates/monoblue/fileannotate.tmpl b/mercurial/templates/monoblue/fileannotate.tmpl --- a/mercurial/templates/monoblue/fileannotate.tmpl +++ b/mercurial/templates/monoblue/fileannotate.tmpl @@ -42,7 +42,7 @@
author
{author|obfuscate}
date
-
{date|rfc822date}
+
{date|rfc822date}
{branch%filerevbranch}
changeset {rev}
{node|short}
diff --git a/mercurial/templates/monoblue/filerevision.tmpl b/mercurial/templates/monoblue/filerevision.tmpl --- a/mercurial/templates/monoblue/filerevision.tmpl +++ b/mercurial/templates/monoblue/filerevision.tmpl @@ -42,7 +42,7 @@
author
{author|obfuscate}
date
-
{date|rfc822date}
+
{date|rfc822date}
{branch%filerevbranch}
changeset {rev}
{node|short}
diff --git a/mercurial/templates/monoblue/summary.tmpl b/mercurial/templates/monoblue/summary.tmpl --- a/mercurial/templates/monoblue/summary.tmpl +++ b/mercurial/templates/monoblue/summary.tmpl @@ -34,7 +34,7 @@
owner
{owner|obfuscate}
last change
-
{lastchange|rfc822date}
+
{lastchange|rfc822date}

Changes

diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t +++ b/tests/test-hgweb-commands.t @@ -1573,7 +1573,7 @@ Overviews - +
descriptionunknown
ownerFoo Bar <foo.bar@example.com>
last changeThu, 01 Jan 1970 00:00:00 +0000
last changeThu, 01 Jan 1970 00:00:00 +0000
changes