Show More
@@ -121,6 +121,15 b' def permissions(flags):' | |||||
121 | return "-rwxr-xr-x" |
|
121 | return "-rwxr-xr-x" | |
122 | return "-rw-r--r--" |
|
122 | return "-rw-r--r--" | |
123 |
|
123 | |||
|
124 | def xmlescape(text): | |||
|
125 | text = (text | |||
|
126 | .replace('&', '&') | |||
|
127 | .replace('<', '<') | |||
|
128 | .replace('>', '>') | |||
|
129 | .replace('"', '"') | |||
|
130 | .replace("'", ''')) # ' invalid in HTML | |||
|
131 | return re.sub('[\x00-\x08\x0B\x0C\x0E-\x1F]', ' ', text) | |||
|
132 | ||||
124 | filters = { |
|
133 | filters = { | |
125 | "addbreaks": nl2br, |
|
134 | "addbreaks": nl2br, | |
126 | "basename": os.path.basename, |
|
135 | "basename": os.path.basename, | |
@@ -147,5 +156,6 b' filters = {' | |||||
147 | "urlescape": lambda x: urllib.quote(x), |
|
156 | "urlescape": lambda x: urllib.quote(x), | |
148 | "user": lambda x: util.shortuser(x), |
|
157 | "user": lambda x: util.shortuser(x), | |
149 | "stringescape": lambda x: x.encode('string_escape'), |
|
158 | "stringescape": lambda x: x.encode('string_escape'), | |
|
159 | "xmlescape": xmlescape, | |||
150 | } |
|
160 | } | |
151 |
|
161 |
@@ -106,6 +106,7 b" hg log --template '{date|isodate}\\n'" | |||||
106 | hg log --template '{date|rfc822date}\n' |
|
106 | hg log --template '{date|rfc822date}\n' | |
107 | hg log --template '{desc|firstline}\n' |
|
107 | hg log --template '{desc|firstline}\n' | |
108 | hg log --template '{node|short}\n' |
|
108 | hg log --template '{node|short}\n' | |
|
109 | hg log --template '<changeset author="{author|xmlescape}"/>\n' | |||
109 |
|
110 | |||
110 | echo '# formatnode filter works' |
|
111 | echo '# formatnode filter works' | |
111 | echo '# quiet' |
|
112 | echo '# quiet' |
@@ -541,6 +541,14 b' 10e46f2dcbf4' | |||||
541 | 97054abb4ab8 |
|
541 | 97054abb4ab8 | |
542 | b608e9d1a3f0 |
|
542 | b608e9d1a3f0 | |
543 | 1e4e1b8f71e0 |
|
543 | 1e4e1b8f71e0 | |
|
544 | <changeset author="User Name <user@hostname>"/> | |||
|
545 | <changeset author="person"/> | |||
|
546 | <changeset author="person"/> | |||
|
547 | <changeset author="person"/> | |||
|
548 | <changeset author="person"/> | |||
|
549 | <changeset author="other@place"/> | |||
|
550 | <changeset author="A. N. Other <other@place>"/> | |||
|
551 | <changeset author="User Name <user@hostname>"/> | |||
544 | # formatnode filter works |
|
552 | # formatnode filter works | |
545 | # quiet |
|
553 | # quiet | |
546 | 1e4e1b8f71e0 |
|
554 | 1e4e1b8f71e0 |
General Comments 0
You need to be logged in to leave comments.
Login now