Mercurial > hg
changeset 9722:4d9dea174b84
templater: readable dates older than 24 months revert to ISO8601 (issue1006)
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Thu, 05 Nov 2009 15:19:54 +0100 |
parents | 1d75c683ada1 |
children | a235644a0b93 |
files | mercurial/templatefilters.py tests/get-with-headers.py tests/test-hgweb-commands.out tests/test-hgweb-diffs.out tests/test-hgweb-filelog.out tests/test-hgweb-removed.out tests/test-highlight.out |
diffstat | 7 files changed, 33 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templatefilters.py Thu Nov 05 14:44:29 2009 +0100 +++ b/mercurial/templatefilters.py Thu Nov 05 15:19:54 2009 +0100 @@ -40,6 +40,9 @@ return 'in the future' delta = max(1, int(now - then)) + if delta > agescales[0][1] * 2: + return util.shortdate(date) + for t, s in agescales: n = delta // s if n >= 2 or s == 1:
--- a/tests/get-with-headers.py Thu Nov 05 14:44:29 2009 +0100 +++ b/tests/get-with-headers.py Thu Nov 05 15:19:54 2009 +0100 @@ -22,7 +22,6 @@ print "%s: %s" % (h, response.getheader(h)) print data = response.read() -data = re.sub('\d+ years', 'many years', data) sys.stdout.write(data) if 200 <= response.status <= 299:
--- a/tests/test-hgweb-commands.out Thu Nov 05 14:44:29 2009 +0100 +++ b/tests/test-hgweb-commands.out Thu Nov 05 15:19:54 2009 +0100 @@ -210,17 +210,17 @@ <th class="description">description</th> </tr> <tr class="parity0"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> </td> </tr> <tr class="parity1"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td> </tr> <tr class="parity0"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td> </tr> @@ -291,7 +291,7 @@ </tr> <tr> <th class="date">date</th> - <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr> + <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr> <tr> <th class="author">parents</th> <td class="author"></td> @@ -422,7 +422,7 @@ </tr> <tr> <th class="date">date</th> - <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td> + <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td> </tr> <tr> <th class="author">parents</th> @@ -523,7 +523,7 @@ <table cellspacing="0"> <tr class="parity0"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td> <td class="open">stable</td> <td class="link"> @@ -533,7 +533,7 @@ </td> </tr> <tr class="parity1"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td> <td class="inactive">default</td> <td class="link"> @@ -608,7 +608,7 @@ <table cellspacing="0"> <tr class="parity0"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><i>test</i></td> <td> <a class="list" href="/rev/1d22e65f027e?style=gitweb"> @@ -622,7 +622,7 @@ </td> </tr> <tr class="parity1"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><i>test</i></td> <td> <a class="list" href="/rev/a4f92ed23982?style=gitweb"> @@ -636,7 +636,7 @@ </td> </tr> <tr class="parity0"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><i>test</i></td> <td> <a class="list" href="/rev/2ef0ac749a14?style=gitweb"> @@ -656,7 +656,7 @@ <table cellspacing="0"> <tr class="parity0"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>1.0</b></a></td> <td class="link"> <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> | @@ -671,7 +671,7 @@ <table cellspacing="0"> <tr class="parity0"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td> <td class="">stable</td> <td class="link"> @@ -681,7 +681,7 @@ </td> </tr> <tr class="parity1"> -<td class="age"><i>many years ago</i></td> +<td class="age"><i>1970-01-01</i></td> <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td> <td class="">default</td> <td class="link"> @@ -764,7 +764,7 @@ <script> <!-- hide script content -var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "many years ago", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "many years ago", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "many years ago", ["default", false], ["1.0"]]]; +var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]]; var graph = new Graph(); graph.scale(39);
--- a/tests/test-hgweb-diffs.out Thu Nov 05 14:44:29 2009 +0100 +++ b/tests/test-hgweb-diffs.out Thu Nov 05 15:19:54 2009 +0100 @@ -59,7 +59,7 @@ </tr> <tr> <th class="date">date</th> - <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr> + <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr> <tr> <th class="author">parents</th> <td class="author"></td> @@ -177,7 +177,7 @@ </tr> <tr> <th>date</th> - <td>Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td> + <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td> </tr> <tr> <th>parents</th> @@ -264,7 +264,7 @@ </tr> <tr> <th class="date">date</th> - <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr> + <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr> <tr> <th class="author">parents</th> <td class="author"></td> @@ -386,7 +386,7 @@ </tr> <tr> <th>date</th> - <td>Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td> + <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td> </tr> <tr> <th>parents</th>
--- a/tests/test-hgweb-filelog.out Thu Nov 05 14:44:29 2009 +0100 +++ b/tests/test-hgweb-filelog.out Thu Nov 05 15:19:54 2009 +0100 @@ -148,12 +148,12 @@ <th class="description">description</th> </tr> <tr class="parity0"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/01de2d66a28d">second a</a></td> </tr> <tr class="parity1"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/5ed941583260">first a</a></td> </tr> @@ -231,12 +231,12 @@ <th class="description">description</th> </tr> <tr class="parity0"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/01de2d66a28d">second a</a></td> </tr> <tr class="parity1"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/5ed941583260">first a</a></td> </tr> @@ -314,7 +314,7 @@ <th class="description">description</th> </tr> <tr class="parity0"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/5ed941583260">first a</a></td> </tr> @@ -392,7 +392,7 @@ <th class="description">description</th> </tr> <tr class="parity0"> - <td class="age">many years ago</td> + <td class="age">1970-01-01</td> <td class="author">test</td> <td class="description"><a href="/rev/5ed941583260">first a</a></td> </tr> @@ -499,7 +499,7 @@ <table class="logEntry parity0"> <tr> - <th class="age">many years ago:</th> + <th class="age">1970-01-01:</th> <th class="firstline"><a href="/rev/38d962e6234d?style=spartan">change c</a></th> </tr> <tr> @@ -524,7 +524,7 @@ <table class="logEntry parity1"> <tr> - <th class="age">many years ago:</th> + <th class="age">1970-01-01:</th> <th class="firstline"><a href="/rev/a3b6a9e4507e?style=spartan">mv b</a></th> </tr> <tr>
--- a/tests/test-hgweb-removed.out Thu Nov 05 14:44:29 2009 +0100 +++ b/tests/test-hgweb-removed.out Thu Nov 05 15:19:54 2009 +0100 @@ -57,7 +57,7 @@ </tr> <tr> <th class="date">date</th> - <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr> + <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr> <tr> <th class="author">parents</th> <td class="author"><a href="/rev/cb9a9f314b8b">cb9a9f314b8b</a> </td> @@ -149,7 +149,7 @@ </tr> <tr> <th>date</th> - <td>Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td> + <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td> </tr> <tr> <th>parents</th>
--- a/tests/test-highlight.out Thu Nov 05 14:44:29 2009 +0100 +++ b/tests/test-highlight.out Thu Nov 05 15:19:54 2009 +0100 @@ -61,7 +61,7 @@ </tr> <tr> <th class="date">date</th> - <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td> + <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td> </tr> <tr> <th class="author">parents</th> @@ -181,7 +181,7 @@ </tr> <tr> <th class="date">date</th> - <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td> + <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td> </tr> <tr> <th class="author">parents</th>