Commit Graph

19 Commits

Author SHA1 Message Date
Nicolas Dumazet
7eadbe8d42 for calls expecting bool args, pass bool instead of int
str.splitlines and email.message.as_string both expect a bool argument
defaulting at False: replace f(1) by f(True) and f(0) by f()
2009-07-13 09:50:26 +09:00
Alejandro Santos
3183e52503 compat: use // for integer division 2009-07-05 11:00:44 +02:00
Marco Beck
47e33d1f81 templater: retain author's full name if no email is supplied (issue1685) 2009-06-03 14:50:03 +02:00
Henrik Stuart
01c54d72e3 templatefilters: add filter to convert date to local date (issue1674)
Issue1674 suggests the localdate filter be applied as default to log,
but this patch only introduces the filter, not the changed default
behaviour.
2009-05-24 11:41:07 +02:00
Peter Arrenbrecht
a75765cf7f drop unused imports 2009-05-14 15:35:46 +02:00
Peter Arrenbrecht
3d9bf2f616 indentation cleanup 2009-05-14 15:24:36 +02:00
Dirkjan Ochtman
5c6c43b746 templater: provide the standard template filters by default 2009-05-12 12:04:05 +02:00
Rocco Rutte
9aa9232b09 templatefilters: add "nonempty" template filter
It ensures that at least "(none)" is returned in case the argument
passed is None or ''. This is primarily useful to render empty
changelog messages for hgweb but may be useful for others, too.
2009-04-20 11:34:15 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Aleix Conchillo Flaque
95a32f54b8 templatefilters: add new stripdir filter
Adds a new template filter for removing directory levels from a
string. Examples:

{foo|stripdir} -> 'foo'
{foo/bar|stripdir} -> 'foo'
{foo/bar/more|stripdir} -> 'foo/bar'
{foo/bar/more|stripdir|stripdir} -> 'foo'
2009-04-24 18:37:44 +02:00
Dirkjan Ochtman
813ed2656a templatefilters: split out jsonescape() function 2009-04-06 10:51:45 +02:00
Matt Mackall
642f4d7151 move encoding bits from util to encoding
In addition to cleaning up util, this gets rid of some circular dependencies.
2009-04-03 14:51:48 -05:00
Dirkjan Ochtman
4e4940dc82 templater: fix age filter to state the obvious on future timestamps 2009-01-22 16:07:44 +01:00
Dirkjan Ochtman
4f94568371 add graph page to hgweb 2008-06-18 07:06:41 +02:00
Giorgos Keramidas
54f4ca2511 Add an {isodatesec} template, to show seconds too. 2008-03-17 19:17:54 +02:00
Matt Mackall
555abf8390 dates: improve timezone handling
datestr:
- add format specifiers %1 and %2 for timezone hours and minutes
- remove timezone and timezone format options
- correctly find timezone hours and minutes for fractional and negative timezones
- update users

strdate:
- correctly find timezone hours and minutes for fractional and negative timezones
2008-03-11 17:42:41 -05:00
Jesse Glick
cf2fd9f31a Permit XML entities to be escaped in template output.
Useful for creating XML documents directly from Hg logging. Can also be used for
HTML. For use in content, will escape '&', '<', and for completeness '>'
(although it is not strictly necessary). For use in attributes, will also escape
' and ". Will also replace nonprinting (ASCII) control characters with spaces,
since these are illegal in XML.
2008-01-28 22:19:12 -05:00
Thomas Arendsen Hein
728ba019da Make annotae/grep print short dates with -q/--quiet.
Move shortdate() from templatefilters to util to avoid code duplication.
2008-02-16 13:33:38 +01:00
Matt Mackall
41e5c79455 templates: move filters to their own module
This eliminates just about all Mercurial dependencies in templater.py
2008-01-31 14:44:19 -06:00