##// END OF EJS Templates
templater: readable dates older than 24 months revert to ISO8601 (issue1006)
Dirkjan Ochtman -
r9722:4d9dea17 default
parent child Browse files
Show More
@@ -40,6 +40,9 b' def age(date):'
40 40 return 'in the future'
41 41
42 42 delta = max(1, int(now - then))
43 if delta > agescales[0][1] * 2:
44 return util.shortdate(date)
45
43 46 for t, s in agescales:
44 47 n = delta // s
45 48 if n >= 2 or s == 1:
@@ -22,7 +22,6 b' for h in headers:'
22 22 print "%s: %s" % (h, response.getheader(h))
23 23 print
24 24 data = response.read()
25 data = re.sub('\d+ years', 'many years', data)
26 25 sys.stdout.write(data)
27 26
28 27 if 200 <= response.status <= 299:
@@ -210,17 +210,17 b' files, or words in the commit message</d'
210 210 <th class="description">description</th>
211 211 </tr>
212 212 <tr class="parity0">
213 <td class="age">many years ago</td>
213 <td class="age">1970-01-01</td>
214 214 <td class="author">test</td>
215 215 <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> </td>
216 216 </tr>
217 217 <tr class="parity1">
218 <td class="age">many years ago</td>
218 <td class="age">1970-01-01</td>
219 219 <td class="author">test</td>
220 220 <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td>
221 221 </tr>
222 222 <tr class="parity0">
223 <td class="age">many years ago</td>
223 <td class="age">1970-01-01</td>
224 224 <td class="author">test</td>
225 225 <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
226 226 </tr>
@@ -291,7 +291,7 b' files, or words in the commit message</d'
291 291 </tr>
292 292 <tr>
293 293 <th class="date">date</th>
294 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr>
294 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
295 295 <tr>
296 296 <th class="author">parents</th>
297 297 <td class="author"></td>
@@ -422,7 +422,7 b' files, or words in the commit message</d'
422 422 </tr>
423 423 <tr>
424 424 <th class="date">date</th>
425 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td>
425 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
426 426 </tr>
427 427 <tr>
428 428 <th class="author">parents</th>
@@ -523,7 +523,7 b' branches |'
523 523 <table cellspacing="0">
524 524
525 525 <tr class="parity0">
526 <td class="age"><i>many years ago</i></td>
526 <td class="age"><i>1970-01-01</i></td>
527 527 <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td>
528 528 <td class="open">stable</td>
529 529 <td class="link">
@@ -533,7 +533,7 b' branches |'
533 533 </td>
534 534 </tr>
535 535 <tr class="parity1">
536 <td class="age"><i>many years ago</i></td>
536 <td class="age"><i>1970-01-01</i></td>
537 537 <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td>
538 538 <td class="inactive">default</td>
539 539 <td class="link">
@@ -608,7 +608,7 b' summary |'
608 608 <table cellspacing="0">
609 609
610 610 <tr class="parity0">
611 <td class="age"><i>many years ago</i></td>
611 <td class="age"><i>1970-01-01</i></td>
612 612 <td><i>test</i></td>
613 613 <td>
614 614 <a class="list" href="/rev/1d22e65f027e?style=gitweb">
@@ -622,7 +622,7 b' summary |'
622 622 </td>
623 623 </tr>
624 624 <tr class="parity1">
625 <td class="age"><i>many years ago</i></td>
625 <td class="age"><i>1970-01-01</i></td>
626 626 <td><i>test</i></td>
627 627 <td>
628 628 <a class="list" href="/rev/a4f92ed23982?style=gitweb">
@@ -636,7 +636,7 b' summary |'
636 636 </td>
637 637 </tr>
638 638 <tr class="parity0">
639 <td class="age"><i>many years ago</i></td>
639 <td class="age"><i>1970-01-01</i></td>
640 640 <td><i>test</i></td>
641 641 <td>
642 642 <a class="list" href="/rev/2ef0ac749a14?style=gitweb">
@@ -656,7 +656,7 b' summary |'
656 656 <table cellspacing="0">
657 657
658 658 <tr class="parity0">
659 <td class="age"><i>many years ago</i></td>
659 <td class="age"><i>1970-01-01</i></td>
660 660 <td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>1.0</b></a></td>
661 661 <td class="link">
662 662 <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
@@ -671,7 +671,7 b' summary |'
671 671 <table cellspacing="0">
672 672
673 673 <tr class="parity0">
674 <td class="age"><i>many years ago</i></td>
674 <td class="age"><i>1970-01-01</i></td>
675 675 <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td>
676 676 <td class="">stable</td>
677 677 <td class="link">
@@ -681,7 +681,7 b' summary |'
681 681 </td>
682 682 </tr>
683 683 <tr class="parity1">
684 <td class="age"><i>many years ago</i></td>
684 <td class="age"><i>1970-01-01</i></td>
685 685 <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td>
686 686 <td class="">default</td>
687 687 <td class="link">
@@ -764,7 +764,7 b' graph |'
764 764 <script>
765 765 <!-- hide script content
766 766
767 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"]]];
767 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"]]];
768 768 var graph = new Graph();
769 769 graph.scale(39);
770 770
@@ -59,7 +59,7 b' files, or words in the commit message</d'
59 59 </tr>
60 60 <tr>
61 61 <th class="date">date</th>
62 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr>
62 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
63 63 <tr>
64 64 <th class="author">parents</th>
65 65 <td class="author"></td>
@@ -177,7 +177,7 b' files, or words in the commit message</d'
177 177 </tr>
178 178 <tr>
179 179 <th>date</th>
180 <td>Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td>
180 <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
181 181 </tr>
182 182 <tr>
183 183 <th>parents</th>
@@ -264,7 +264,7 b' files, or words in the commit message</d'
264 264 </tr>
265 265 <tr>
266 266 <th class="date">date</th>
267 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr>
267 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
268 268 <tr>
269 269 <th class="author">parents</th>
270 270 <td class="author"></td>
@@ -386,7 +386,7 b' files, or words in the commit message</d'
386 386 </tr>
387 387 <tr>
388 388 <th>date</th>
389 <td>Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td>
389 <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
390 390 </tr>
391 391 <tr>
392 392 <th>parents</th>
@@ -148,12 +148,12 b' files, or words in the commit message</d'
148 148 <th class="description">description</th>
149 149 </tr>
150 150 <tr class="parity0">
151 <td class="age">many years ago</td>
151 <td class="age">1970-01-01</td>
152 152 <td class="author">test</td>
153 153 <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
154 154 </tr>
155 155 <tr class="parity1">
156 <td class="age">many years ago</td>
156 <td class="age">1970-01-01</td>
157 157 <td class="author">test</td>
158 158 <td class="description"><a href="/rev/5ed941583260">first a</a></td>
159 159 </tr>
@@ -231,12 +231,12 b' files, or words in the commit message</d'
231 231 <th class="description">description</th>
232 232 </tr>
233 233 <tr class="parity0">
234 <td class="age">many years ago</td>
234 <td class="age">1970-01-01</td>
235 235 <td class="author">test</td>
236 236 <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
237 237 </tr>
238 238 <tr class="parity1">
239 <td class="age">many years ago</td>
239 <td class="age">1970-01-01</td>
240 240 <td class="author">test</td>
241 241 <td class="description"><a href="/rev/5ed941583260">first a</a></td>
242 242 </tr>
@@ -314,7 +314,7 b' files, or words in the commit message</d'
314 314 <th class="description">description</th>
315 315 </tr>
316 316 <tr class="parity0">
317 <td class="age">many years ago</td>
317 <td class="age">1970-01-01</td>
318 318 <td class="author">test</td>
319 319 <td class="description"><a href="/rev/5ed941583260">first a</a></td>
320 320 </tr>
@@ -392,7 +392,7 b' files, or words in the commit message</d'
392 392 <th class="description">description</th>
393 393 </tr>
394 394 <tr class="parity0">
395 <td class="age">many years ago</td>
395 <td class="age">1970-01-01</td>
396 396 <td class="author">test</td>
397 397 <td class="description"><a href="/rev/5ed941583260">first a</a></td>
398 398 </tr>
@@ -499,7 +499,7 b' 200 Script output follows'
499 499
500 500 <table class="logEntry parity0">
501 501 <tr>
502 <th class="age">many years ago:</th>
502 <th class="age">1970-01-01:</th>
503 503 <th class="firstline"><a href="/rev/38d962e6234d?style=spartan">change c</a></th>
504 504 </tr>
505 505 <tr>
@@ -524,7 +524,7 b' 200 Script output follows'
524 524
525 525 <table class="logEntry parity1">
526 526 <tr>
527 <th class="age">many years ago:</th>
527 <th class="age">1970-01-01:</th>
528 528 <th class="firstline"><a href="/rev/a3b6a9e4507e?style=spartan">mv b</a></th>
529 529 </tr>
530 530 <tr>
@@ -57,7 +57,7 b' files, or words in the commit message</d'
57 57 </tr>
58 58 <tr>
59 59 <th class="date">date</th>
60 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td></tr>
60 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
61 61 <tr>
62 62 <th class="author">parents</th>
63 63 <td class="author"><a href="/rev/cb9a9f314b8b">cb9a9f314b8b</a> </td>
@@ -149,7 +149,7 b' files, or words in the commit message</d'
149 149 </tr>
150 150 <tr>
151 151 <th>date</th>
152 <td>Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td>
152 <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
153 153 </tr>
154 154 <tr>
155 155 <th>parents</th>
@@ -61,7 +61,7 b' files, or words in the commit message</d'
61 61 </tr>
62 62 <tr>
63 63 <th class="date">date</th>
64 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td>
64 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
65 65 </tr>
66 66 <tr>
67 67 <th class="author">parents</th>
@@ -181,7 +181,7 b' files, or words in the commit message</d'
181 181 </tr>
182 182 <tr>
183 183 <th class="date">date</th>
184 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td>
184 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
185 185 </tr>
186 186 <tr>
187 187 <th class="author">parents</th>
General Comments 0
You need to be logged in to leave comments. Login now