# HG changeset patch # User Anton Shestakov # Date 1518700497 -28800 # Node ID 7ec5925c971e6dbf893776207de1d04753e094ad # Parent 881596e51fca95ca094d92a1a3db81539c40c0bd hgweb: show dates recorded in obsolescence markers Dates of operations that obsolete commits are also important enough to be shown, but maybe not as important as original commit dates, that and also for brevity is why they are wrapped in a with only "age" class. Provided that JS is enabled, such elements only show age (e.g. "3 months ago"), and the exact date is visible in a tooltip. Commits dates, on the other hand, show both date and age (the latter in parenthesis). Example result for f1a0933ce59e from hg-committed: obsolete: pruned by Yuya Nishihara 13 days ago diff -r 881596e51fca -r 7ec5925c971e mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map Thu Feb 15 21:05:31 2018 +0800 +++ b/mercurial/templates/gitweb/map Thu Feb 15 21:14:57 2018 +0800 @@ -276,7 +276,8 @@ obsfateverb = '{obsfateverb(successors, markers)}' obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}' +obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' +obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' shortlogentry = ' {date|rfc822date} diff -r 881596e51fca -r 7ec5925c971e mercurial/templates/monoblue/map --- a/mercurial/templates/monoblue/map Thu Feb 15 21:05:31 2018 +0800 +++ b/mercurial/templates/monoblue/map Thu Feb 15 21:14:57 2018 +0800 @@ -234,7 +234,8 @@ obsfateverb = '{obsfateverb(successors, markers)}' obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}' +obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' +obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' shortlogentry = ' {date|rfc822date} diff -r 881596e51fca -r 7ec5925c971e mercurial/templates/paper/map --- a/mercurial/templates/paper/map Thu Feb 15 21:05:31 2018 +0800 +++ b/mercurial/templates/paper/map Thu Feb 15 21:14:57 2018 +0800 @@ -214,7 +214,8 @@ obsfateverb = '{obsfateverb(successors, markers)}' obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}' +obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' +obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' filediffparent = ' diff -r 881596e51fca -r 7ec5925c971e mercurial/templates/spartan/map --- a/mercurial/templates/spartan/map Thu Feb 15 21:05:31 2018 +0800 +++ b/mercurial/templates/spartan/map Thu Feb 15 21:14:57 2018 +0800 @@ -171,7 +171,8 @@ obsfateverb = '{obsfateverb(successors, markers)}' obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}' +obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' +obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' filediffparent = ' parent {rev}: diff -r 881596e51fca -r 7ec5925c971e tests/test-obsolete.t --- a/tests/test-obsolete.t Thu Feb 15 21:05:31 2018 +0800 +++ b/tests/test-obsolete.t Thu Feb 15 21:14:57 2018 +0800 @@ -1050,19 +1050,19 @@ draft obsolete $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=spartan' | grep 'class="obsolete"' obsolete: - pruned by test + pruned by test Thu, 01 Jan 1970 00:00:00 +0000 check an obsolete changeset that has been rewritten $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=paper' | grep rewritten - rewritten as 3de5eca88c00 by test <test@example.net> + rewritten as 3de5eca88c00 by test <test@example.net> Thu, 01 Jan 1970 00:00:00 +0000 $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=coal' | grep rewritten - rewritten as 3de5eca88c00 by test <test@example.net> + rewritten as 3de5eca88c00 by test <test@example.net> Thu, 01 Jan 1970 00:00:00 +0000 $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=gitweb' | grep rewritten - obsoleterewritten as 3de5eca88c00 by test <test@example.net> + obsoleterewritten as 3de5eca88c00 by test <test@example.net> Thu, 01 Jan 1970 00:00:00 +0000 $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=monoblue' | grep rewritten -
obsolete
rewritten as 3de5eca88c00 by test <test@example.net>
+
obsolete
rewritten as 3de5eca88c00 by test <test@example.net> Thu, 01 Jan 1970 00:00:00 +0000
$ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=spartan' | grep rewritten - rewritten as 3de5eca88c00 by test <test@example.net> + rewritten as 3de5eca88c00 by test <test@example.net> Thu, 01 Jan 1970 00:00:00 +0000 check changeset with instabilities