##// END OF EJS Templates
templatefilters: add "upper" and "lower" for case conversion...
Yuya Nishihara -
r24566:6abce80e default
parent child Browse files
Show More
@@ -1,421 +1,431 b''
1 # template-filters.py - common template expansion filters
1 # template-filters.py - common template expansion filters
2 #
2 #
3 # Copyright 2005-2008 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2008 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import cgi, re, os, time, urllib
8 import cgi, re, os, time, urllib
9 import encoding, node, util
9 import encoding, node, util
10 import hbisect
10 import hbisect
11 import templatekw
11 import templatekw
12
12
13 def addbreaks(text):
13 def addbreaks(text):
14 """:addbreaks: Any text. Add an XHTML "<br />" tag before the end of
14 """:addbreaks: Any text. Add an XHTML "<br />" tag before the end of
15 every line except the last.
15 every line except the last.
16 """
16 """
17 return text.replace('\n', '<br/>\n')
17 return text.replace('\n', '<br/>\n')
18
18
19 agescales = [("year", 3600 * 24 * 365, 'Y'),
19 agescales = [("year", 3600 * 24 * 365, 'Y'),
20 ("month", 3600 * 24 * 30, 'M'),
20 ("month", 3600 * 24 * 30, 'M'),
21 ("week", 3600 * 24 * 7, 'W'),
21 ("week", 3600 * 24 * 7, 'W'),
22 ("day", 3600 * 24, 'd'),
22 ("day", 3600 * 24, 'd'),
23 ("hour", 3600, 'h'),
23 ("hour", 3600, 'h'),
24 ("minute", 60, 'm'),
24 ("minute", 60, 'm'),
25 ("second", 1, 's')]
25 ("second", 1, 's')]
26
26
27 def age(date, abbrev=False):
27 def age(date, abbrev=False):
28 """:age: Date. Returns a human-readable date/time difference between the
28 """:age: Date. Returns a human-readable date/time difference between the
29 given date/time and the current date/time.
29 given date/time and the current date/time.
30 """
30 """
31
31
32 def plural(t, c):
32 def plural(t, c):
33 if c == 1:
33 if c == 1:
34 return t
34 return t
35 return t + "s"
35 return t + "s"
36 def fmt(t, c, a):
36 def fmt(t, c, a):
37 if abbrev:
37 if abbrev:
38 return "%d%s" % (c, a)
38 return "%d%s" % (c, a)
39 return "%d %s" % (c, plural(t, c))
39 return "%d %s" % (c, plural(t, c))
40
40
41 now = time.time()
41 now = time.time()
42 then = date[0]
42 then = date[0]
43 future = False
43 future = False
44 if then > now:
44 if then > now:
45 future = True
45 future = True
46 delta = max(1, int(then - now))
46 delta = max(1, int(then - now))
47 if delta > agescales[0][1] * 30:
47 if delta > agescales[0][1] * 30:
48 return 'in the distant future'
48 return 'in the distant future'
49 else:
49 else:
50 delta = max(1, int(now - then))
50 delta = max(1, int(now - then))
51 if delta > agescales[0][1] * 2:
51 if delta > agescales[0][1] * 2:
52 return util.shortdate(date)
52 return util.shortdate(date)
53
53
54 for t, s, a in agescales:
54 for t, s, a in agescales:
55 n = delta // s
55 n = delta // s
56 if n >= 2 or s == 1:
56 if n >= 2 or s == 1:
57 if future:
57 if future:
58 return '%s from now' % fmt(t, n, a)
58 return '%s from now' % fmt(t, n, a)
59 return '%s ago' % fmt(t, n, a)
59 return '%s ago' % fmt(t, n, a)
60
60
61 def basename(path):
61 def basename(path):
62 """:basename: Any text. Treats the text as a path, and returns the last
62 """:basename: Any text. Treats the text as a path, and returns the last
63 component of the path after splitting by the path separator
63 component of the path after splitting by the path separator
64 (ignoring trailing separators). For example, "foo/bar/baz" becomes
64 (ignoring trailing separators). For example, "foo/bar/baz" becomes
65 "baz" and "foo/bar//" becomes "bar".
65 "baz" and "foo/bar//" becomes "bar".
66 """
66 """
67 return os.path.basename(path)
67 return os.path.basename(path)
68
68
69 def count(i):
69 def count(i):
70 """:count: List or text. Returns the length as an integer."""
70 """:count: List or text. Returns the length as an integer."""
71 return len(i)
71 return len(i)
72
72
73 def datefilter(text):
73 def datefilter(text):
74 """:date: Date. Returns a date in a Unix date format, including the
74 """:date: Date. Returns a date in a Unix date format, including the
75 timezone: "Mon Sep 04 15:13:13 2006 0700".
75 timezone: "Mon Sep 04 15:13:13 2006 0700".
76 """
76 """
77 return util.datestr(text)
77 return util.datestr(text)
78
78
79 def domain(author):
79 def domain(author):
80 """:domain: Any text. Finds the first string that looks like an email
80 """:domain: Any text. Finds the first string that looks like an email
81 address, and extracts just the domain component. Example: ``User
81 address, and extracts just the domain component. Example: ``User
82 <user@example.com>`` becomes ``example.com``.
82 <user@example.com>`` becomes ``example.com``.
83 """
83 """
84 f = author.find('@')
84 f = author.find('@')
85 if f == -1:
85 if f == -1:
86 return ''
86 return ''
87 author = author[f + 1:]
87 author = author[f + 1:]
88 f = author.find('>')
88 f = author.find('>')
89 if f >= 0:
89 if f >= 0:
90 author = author[:f]
90 author = author[:f]
91 return author
91 return author
92
92
93 def email(text):
93 def email(text):
94 """:email: Any text. Extracts the first string that looks like an email
94 """:email: Any text. Extracts the first string that looks like an email
95 address. Example: ``User <user@example.com>`` becomes
95 address. Example: ``User <user@example.com>`` becomes
96 ``user@example.com``.
96 ``user@example.com``.
97 """
97 """
98 return util.email(text)
98 return util.email(text)
99
99
100 def escape(text):
100 def escape(text):
101 """:escape: Any text. Replaces the special XML/XHTML characters "&", "<"
101 """:escape: Any text. Replaces the special XML/XHTML characters "&", "<"
102 and ">" with XML entities, and filters out NUL characters.
102 and ">" with XML entities, and filters out NUL characters.
103 """
103 """
104 return cgi.escape(text.replace('\0', ''), True)
104 return cgi.escape(text.replace('\0', ''), True)
105
105
106 para_re = None
106 para_re = None
107 space_re = None
107 space_re = None
108
108
109 def fill(text, width, initindent='', hangindent=''):
109 def fill(text, width, initindent='', hangindent=''):
110 '''fill many paragraphs with optional indentation.'''
110 '''fill many paragraphs with optional indentation.'''
111 global para_re, space_re
111 global para_re, space_re
112 if para_re is None:
112 if para_re is None:
113 para_re = re.compile('(\n\n|\n\\s*[-*]\\s*)', re.M)
113 para_re = re.compile('(\n\n|\n\\s*[-*]\\s*)', re.M)
114 space_re = re.compile(r' +')
114 space_re = re.compile(r' +')
115
115
116 def findparas():
116 def findparas():
117 start = 0
117 start = 0
118 while True:
118 while True:
119 m = para_re.search(text, start)
119 m = para_re.search(text, start)
120 if not m:
120 if not m:
121 uctext = unicode(text[start:], encoding.encoding)
121 uctext = unicode(text[start:], encoding.encoding)
122 w = len(uctext)
122 w = len(uctext)
123 while 0 < w and uctext[w - 1].isspace():
123 while 0 < w and uctext[w - 1].isspace():
124 w -= 1
124 w -= 1
125 yield (uctext[:w].encode(encoding.encoding),
125 yield (uctext[:w].encode(encoding.encoding),
126 uctext[w:].encode(encoding.encoding))
126 uctext[w:].encode(encoding.encoding))
127 break
127 break
128 yield text[start:m.start(0)], m.group(1)
128 yield text[start:m.start(0)], m.group(1)
129 start = m.end(1)
129 start = m.end(1)
130
130
131 return "".join([util.wrap(space_re.sub(' ', util.wrap(para, width)),
131 return "".join([util.wrap(space_re.sub(' ', util.wrap(para, width)),
132 width, initindent, hangindent) + rest
132 width, initindent, hangindent) + rest
133 for para, rest in findparas()])
133 for para, rest in findparas()])
134
134
135 def fill68(text):
135 def fill68(text):
136 """:fill68: Any text. Wraps the text to fit in 68 columns."""
136 """:fill68: Any text. Wraps the text to fit in 68 columns."""
137 return fill(text, 68)
137 return fill(text, 68)
138
138
139 def fill76(text):
139 def fill76(text):
140 """:fill76: Any text. Wraps the text to fit in 76 columns."""
140 """:fill76: Any text. Wraps the text to fit in 76 columns."""
141 return fill(text, 76)
141 return fill(text, 76)
142
142
143 def firstline(text):
143 def firstline(text):
144 """:firstline: Any text. Returns the first line of text."""
144 """:firstline: Any text. Returns the first line of text."""
145 try:
145 try:
146 return text.splitlines(True)[0].rstrip('\r\n')
146 return text.splitlines(True)[0].rstrip('\r\n')
147 except IndexError:
147 except IndexError:
148 return ''
148 return ''
149
149
150 def hexfilter(text):
150 def hexfilter(text):
151 """:hex: Any text. Convert a binary Mercurial node identifier into
151 """:hex: Any text. Convert a binary Mercurial node identifier into
152 its long hexadecimal representation.
152 its long hexadecimal representation.
153 """
153 """
154 return node.hex(text)
154 return node.hex(text)
155
155
156 def hgdate(text):
156 def hgdate(text):
157 """:hgdate: Date. Returns the date as a pair of numbers: "1157407993
157 """:hgdate: Date. Returns the date as a pair of numbers: "1157407993
158 25200" (Unix timestamp, timezone offset).
158 25200" (Unix timestamp, timezone offset).
159 """
159 """
160 return "%d %d" % text
160 return "%d %d" % text
161
161
162 def isodate(text):
162 def isodate(text):
163 """:isodate: Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
163 """:isodate: Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
164 +0200".
164 +0200".
165 """
165 """
166 return util.datestr(text, '%Y-%m-%d %H:%M %1%2')
166 return util.datestr(text, '%Y-%m-%d %H:%M %1%2')
167
167
168 def isodatesec(text):
168 def isodatesec(text):
169 """:isodatesec: Date. Returns the date in ISO 8601 format, including
169 """:isodatesec: Date. Returns the date in ISO 8601 format, including
170 seconds: "2009-08-18 13:00:13 +0200". See also the rfc3339date
170 seconds: "2009-08-18 13:00:13 +0200". See also the rfc3339date
171 filter.
171 filter.
172 """
172 """
173 return util.datestr(text, '%Y-%m-%d %H:%M:%S %1%2')
173 return util.datestr(text, '%Y-%m-%d %H:%M:%S %1%2')
174
174
175 def indent(text, prefix):
175 def indent(text, prefix):
176 '''indent each non-empty line of text after first with prefix.'''
176 '''indent each non-empty line of text after first with prefix.'''
177 lines = text.splitlines()
177 lines = text.splitlines()
178 num_lines = len(lines)
178 num_lines = len(lines)
179 endswithnewline = text[-1:] == '\n'
179 endswithnewline = text[-1:] == '\n'
180 def indenter():
180 def indenter():
181 for i in xrange(num_lines):
181 for i in xrange(num_lines):
182 l = lines[i]
182 l = lines[i]
183 if i and l.strip():
183 if i and l.strip():
184 yield prefix
184 yield prefix
185 yield l
185 yield l
186 if i < num_lines - 1 or endswithnewline:
186 if i < num_lines - 1 or endswithnewline:
187 yield '\n'
187 yield '\n'
188 return "".join(indenter())
188 return "".join(indenter())
189
189
190 def json(obj):
190 def json(obj):
191 if obj is None or obj is False or obj is True:
191 if obj is None or obj is False or obj is True:
192 return {None: 'null', False: 'false', True: 'true'}[obj]
192 return {None: 'null', False: 'false', True: 'true'}[obj]
193 elif isinstance(obj, int) or isinstance(obj, float):
193 elif isinstance(obj, int) or isinstance(obj, float):
194 return str(obj)
194 return str(obj)
195 elif isinstance(obj, str):
195 elif isinstance(obj, str):
196 u = unicode(obj, encoding.encoding, 'replace')
196 u = unicode(obj, encoding.encoding, 'replace')
197 return '"%s"' % jsonescape(u)
197 return '"%s"' % jsonescape(u)
198 elif isinstance(obj, unicode):
198 elif isinstance(obj, unicode):
199 return '"%s"' % jsonescape(obj)
199 return '"%s"' % jsonescape(obj)
200 elif util.safehasattr(obj, 'keys'):
200 elif util.safehasattr(obj, 'keys'):
201 out = []
201 out = []
202 for k, v in sorted(obj.iteritems()):
202 for k, v in sorted(obj.iteritems()):
203 s = '%s: %s' % (json(k), json(v))
203 s = '%s: %s' % (json(k), json(v))
204 out.append(s)
204 out.append(s)
205 return '{' + ', '.join(out) + '}'
205 return '{' + ', '.join(out) + '}'
206 elif util.safehasattr(obj, '__iter__'):
206 elif util.safehasattr(obj, '__iter__'):
207 out = []
207 out = []
208 for i in obj:
208 for i in obj:
209 out.append(json(i))
209 out.append(json(i))
210 return '[' + ', '.join(out) + ']'
210 return '[' + ', '.join(out) + ']'
211 elif util.safehasattr(obj, '__call__'):
211 elif util.safehasattr(obj, '__call__'):
212 return json(obj())
212 return json(obj())
213 else:
213 else:
214 raise TypeError('cannot encode type %s' % obj.__class__.__name__)
214 raise TypeError('cannot encode type %s' % obj.__class__.__name__)
215
215
216 def _uescape(c):
216 def _uescape(c):
217 if ord(c) < 0x80:
217 if ord(c) < 0x80:
218 return c
218 return c
219 else:
219 else:
220 return '\\u%04x' % ord(c)
220 return '\\u%04x' % ord(c)
221
221
222 _escapes = [
222 _escapes = [
223 ('\\', '\\\\'), ('"', '\\"'), ('\t', '\\t'), ('\n', '\\n'),
223 ('\\', '\\\\'), ('"', '\\"'), ('\t', '\\t'), ('\n', '\\n'),
224 ('\r', '\\r'), ('\f', '\\f'), ('\b', '\\b'),
224 ('\r', '\\r'), ('\f', '\\f'), ('\b', '\\b'),
225 ('<', '\\u003c'), ('>', '\\u003e'), ('\0', '\\u0000')
225 ('<', '\\u003c'), ('>', '\\u003e'), ('\0', '\\u0000')
226 ]
226 ]
227
227
228 def jsonescape(s):
228 def jsonescape(s):
229 for k, v in _escapes:
229 for k, v in _escapes:
230 s = s.replace(k, v)
230 s = s.replace(k, v)
231 return ''.join(_uescape(c) for c in s)
231 return ''.join(_uescape(c) for c in s)
232
232
233 def localdate(text):
233 def localdate(text):
234 """:localdate: Date. Converts a date to local date."""
234 """:localdate: Date. Converts a date to local date."""
235 return (util.parsedate(text)[0], util.makedate()[1])
235 return (util.parsedate(text)[0], util.makedate()[1])
236
236
237 def lower(text):
238 """:lower: Any text. Converts the text to lowercase."""
239 return encoding.lower(text)
240
237 def nonempty(str):
241 def nonempty(str):
238 """:nonempty: Any text. Returns '(none)' if the string is empty."""
242 """:nonempty: Any text. Returns '(none)' if the string is empty."""
239 return str or "(none)"
243 return str or "(none)"
240
244
241 def obfuscate(text):
245 def obfuscate(text):
242 """:obfuscate: Any text. Returns the input text rendered as a sequence of
246 """:obfuscate: Any text. Returns the input text rendered as a sequence of
243 XML entities.
247 XML entities.
244 """
248 """
245 text = unicode(text, encoding.encoding, 'replace')
249 text = unicode(text, encoding.encoding, 'replace')
246 return ''.join(['&#%d;' % ord(c) for c in text])
250 return ''.join(['&#%d;' % ord(c) for c in text])
247
251
248 def permissions(flags):
252 def permissions(flags):
249 if "l" in flags:
253 if "l" in flags:
250 return "lrwxrwxrwx"
254 return "lrwxrwxrwx"
251 if "x" in flags:
255 if "x" in flags:
252 return "-rwxr-xr-x"
256 return "-rwxr-xr-x"
253 return "-rw-r--r--"
257 return "-rw-r--r--"
254
258
255 def person(author):
259 def person(author):
256 """:person: Any text. Returns the name before an email address,
260 """:person: Any text. Returns the name before an email address,
257 interpreting it as per RFC 5322.
261 interpreting it as per RFC 5322.
258
262
259 >>> person('foo@bar')
263 >>> person('foo@bar')
260 'foo'
264 'foo'
261 >>> person('Foo Bar <foo@bar>')
265 >>> person('Foo Bar <foo@bar>')
262 'Foo Bar'
266 'Foo Bar'
263 >>> person('"Foo Bar" <foo@bar>')
267 >>> person('"Foo Bar" <foo@bar>')
264 'Foo Bar'
268 'Foo Bar'
265 >>> person('"Foo \"buz\" Bar" <foo@bar>')
269 >>> person('"Foo \"buz\" Bar" <foo@bar>')
266 'Foo "buz" Bar'
270 'Foo "buz" Bar'
267 >>> # The following are invalid, but do exist in real-life
271 >>> # The following are invalid, but do exist in real-life
268 ...
272 ...
269 >>> person('Foo "buz" Bar <foo@bar>')
273 >>> person('Foo "buz" Bar <foo@bar>')
270 'Foo "buz" Bar'
274 'Foo "buz" Bar'
271 >>> person('"Foo Bar <foo@bar>')
275 >>> person('"Foo Bar <foo@bar>')
272 'Foo Bar'
276 'Foo Bar'
273 """
277 """
274 if '@' not in author:
278 if '@' not in author:
275 return author
279 return author
276 f = author.find('<')
280 f = author.find('<')
277 if f != -1:
281 if f != -1:
278 return author[:f].strip(' "').replace('\\"', '"')
282 return author[:f].strip(' "').replace('\\"', '"')
279 f = author.find('@')
283 f = author.find('@')
280 return author[:f].replace('.', ' ')
284 return author[:f].replace('.', ' ')
281
285
282 def rfc3339date(text):
286 def rfc3339date(text):
283 """:rfc3339date: Date. Returns a date using the Internet date format
287 """:rfc3339date: Date. Returns a date using the Internet date format
284 specified in RFC 3339: "2009-08-18T13:00:13+02:00".
288 specified in RFC 3339: "2009-08-18T13:00:13+02:00".
285 """
289 """
286 return util.datestr(text, "%Y-%m-%dT%H:%M:%S%1:%2")
290 return util.datestr(text, "%Y-%m-%dT%H:%M:%S%1:%2")
287
291
288 def rfc822date(text):
292 def rfc822date(text):
289 """:rfc822date: Date. Returns a date using the same format used in email
293 """:rfc822date: Date. Returns a date using the same format used in email
290 headers: "Tue, 18 Aug 2009 13:00:13 +0200".
294 headers: "Tue, 18 Aug 2009 13:00:13 +0200".
291 """
295 """
292 return util.datestr(text, "%a, %d %b %Y %H:%M:%S %1%2")
296 return util.datestr(text, "%a, %d %b %Y %H:%M:%S %1%2")
293
297
294 def short(text):
298 def short(text):
295 """:short: Changeset hash. Returns the short form of a changeset hash,
299 """:short: Changeset hash. Returns the short form of a changeset hash,
296 i.e. a 12 hexadecimal digit string.
300 i.e. a 12 hexadecimal digit string.
297 """
301 """
298 return text[:12]
302 return text[:12]
299
303
300 def shortbisect(text):
304 def shortbisect(text):
301 """:shortbisect: Any text. Treats `text` as a bisection status, and
305 """:shortbisect: Any text. Treats `text` as a bisection status, and
302 returns a single-character representing the status (G: good, B: bad,
306 returns a single-character representing the status (G: good, B: bad,
303 S: skipped, U: untested, I: ignored). Returns single space if `text`
307 S: skipped, U: untested, I: ignored). Returns single space if `text`
304 is not a valid bisection status.
308 is not a valid bisection status.
305 """
309 """
306 return hbisect.shortlabel(text) or ' '
310 return hbisect.shortlabel(text) or ' '
307
311
308 def shortdate(text):
312 def shortdate(text):
309 """:shortdate: Date. Returns a date like "2006-09-18"."""
313 """:shortdate: Date. Returns a date like "2006-09-18"."""
310 return util.shortdate(text)
314 return util.shortdate(text)
311
315
312 def splitlines(text):
316 def splitlines(text):
313 """:splitlines: Any text. Split text into a list of lines."""
317 """:splitlines: Any text. Split text into a list of lines."""
314 return templatekw.showlist('line', text.splitlines(), 'lines')
318 return templatekw.showlist('line', text.splitlines(), 'lines')
315
319
316 def stringescape(text):
320 def stringescape(text):
317 return text.encode('string_escape')
321 return text.encode('string_escape')
318
322
319 def stringify(thing):
323 def stringify(thing):
320 """:stringify: Any type. Turns the value into text by converting values into
324 """:stringify: Any type. Turns the value into text by converting values into
321 text and concatenating them.
325 text and concatenating them.
322 """
326 """
323 if util.safehasattr(thing, '__iter__') and not isinstance(thing, str):
327 if util.safehasattr(thing, '__iter__') and not isinstance(thing, str):
324 return "".join([stringify(t) for t in thing if t is not None])
328 return "".join([stringify(t) for t in thing if t is not None])
325 return str(thing)
329 return str(thing)
326
330
327 def strip(text):
331 def strip(text):
328 """:strip: Any text. Strips all leading and trailing whitespace."""
332 """:strip: Any text. Strips all leading and trailing whitespace."""
329 return text.strip()
333 return text.strip()
330
334
331 def stripdir(text):
335 def stripdir(text):
332 """:stripdir: Treat the text as path and strip a directory level, if
336 """:stripdir: Treat the text as path and strip a directory level, if
333 possible. For example, "foo" and "foo/bar" becomes "foo".
337 possible. For example, "foo" and "foo/bar" becomes "foo".
334 """
338 """
335 dir = os.path.dirname(text)
339 dir = os.path.dirname(text)
336 if dir == "":
340 if dir == "":
337 return os.path.basename(text)
341 return os.path.basename(text)
338 else:
342 else:
339 return dir
343 return dir
340
344
341 def tabindent(text):
345 def tabindent(text):
342 """:tabindent: Any text. Returns the text, with every non-empty line
346 """:tabindent: Any text. Returns the text, with every non-empty line
343 except the first starting with a tab character.
347 except the first starting with a tab character.
344 """
348 """
345 return indent(text, '\t')
349 return indent(text, '\t')
346
350
351 def upper(text):
352 """:upper: Any text. Converts the text to uppercase."""
353 return encoding.upper(text)
354
347 def urlescape(text):
355 def urlescape(text):
348 """:urlescape: Any text. Escapes all "special" characters. For example,
356 """:urlescape: Any text. Escapes all "special" characters. For example,
349 "foo bar" becomes "foo%20bar".
357 "foo bar" becomes "foo%20bar".
350 """
358 """
351 return urllib.quote(text)
359 return urllib.quote(text)
352
360
353 def userfilter(text):
361 def userfilter(text):
354 """:user: Any text. Returns a short representation of a user name or email
362 """:user: Any text. Returns a short representation of a user name or email
355 address."""
363 address."""
356 return util.shortuser(text)
364 return util.shortuser(text)
357
365
358 def emailuser(text):
366 def emailuser(text):
359 """:emailuser: Any text. Returns the user portion of an email address."""
367 """:emailuser: Any text. Returns the user portion of an email address."""
360 return util.emailuser(text)
368 return util.emailuser(text)
361
369
362 def xmlescape(text):
370 def xmlescape(text):
363 text = (text
371 text = (text
364 .replace('&', '&amp;')
372 .replace('&', '&amp;')
365 .replace('<', '&lt;')
373 .replace('<', '&lt;')
366 .replace('>', '&gt;')
374 .replace('>', '&gt;')
367 .replace('"', '&quot;')
375 .replace('"', '&quot;')
368 .replace("'", '&#39;')) # &apos; invalid in HTML
376 .replace("'", '&#39;')) # &apos; invalid in HTML
369 return re.sub('[\x00-\x08\x0B\x0C\x0E-\x1F]', ' ', text)
377 return re.sub('[\x00-\x08\x0B\x0C\x0E-\x1F]', ' ', text)
370
378
371 filters = {
379 filters = {
372 "addbreaks": addbreaks,
380 "addbreaks": addbreaks,
373 "age": age,
381 "age": age,
374 "basename": basename,
382 "basename": basename,
375 "count": count,
383 "count": count,
376 "date": datefilter,
384 "date": datefilter,
377 "domain": domain,
385 "domain": domain,
378 "email": email,
386 "email": email,
379 "escape": escape,
387 "escape": escape,
380 "fill68": fill68,
388 "fill68": fill68,
381 "fill76": fill76,
389 "fill76": fill76,
382 "firstline": firstline,
390 "firstline": firstline,
383 "hex": hexfilter,
391 "hex": hexfilter,
384 "hgdate": hgdate,
392 "hgdate": hgdate,
385 "isodate": isodate,
393 "isodate": isodate,
386 "isodatesec": isodatesec,
394 "isodatesec": isodatesec,
387 "json": json,
395 "json": json,
388 "jsonescape": jsonescape,
396 "jsonescape": jsonescape,
389 "localdate": localdate,
397 "localdate": localdate,
398 "lower": lower,
390 "nonempty": nonempty,
399 "nonempty": nonempty,
391 "obfuscate": obfuscate,
400 "obfuscate": obfuscate,
392 "permissions": permissions,
401 "permissions": permissions,
393 "person": person,
402 "person": person,
394 "rfc3339date": rfc3339date,
403 "rfc3339date": rfc3339date,
395 "rfc822date": rfc822date,
404 "rfc822date": rfc822date,
396 "short": short,
405 "short": short,
397 "shortbisect": shortbisect,
406 "shortbisect": shortbisect,
398 "shortdate": shortdate,
407 "shortdate": shortdate,
399 "splitlines": splitlines,
408 "splitlines": splitlines,
400 "stringescape": stringescape,
409 "stringescape": stringescape,
401 "stringify": stringify,
410 "stringify": stringify,
402 "strip": strip,
411 "strip": strip,
403 "stripdir": stripdir,
412 "stripdir": stripdir,
404 "tabindent": tabindent,
413 "tabindent": tabindent,
414 "upper": upper,
405 "urlescape": urlescape,
415 "urlescape": urlescape,
406 "user": userfilter,
416 "user": userfilter,
407 "emailuser": emailuser,
417 "emailuser": emailuser,
408 "xmlescape": xmlescape,
418 "xmlescape": xmlescape,
409 }
419 }
410
420
411 def websub(text, websubtable):
421 def websub(text, websubtable):
412 """:websub: Any text. Only applies to hgweb. Applies the regular
422 """:websub: Any text. Only applies to hgweb. Applies the regular
413 expression replacements defined in the websub section.
423 expression replacements defined in the websub section.
414 """
424 """
415 if websubtable:
425 if websubtable:
416 for regexp, format in websubtable:
426 for regexp, format in websubtable:
417 text = regexp.sub(format, text)
427 text = regexp.sub(format, text)
418 return text
428 return text
419
429
420 # tell hggettext to extract docstrings from these functions:
430 # tell hggettext to extract docstrings from these functions:
421 i18nfunctions = filters.values()
431 i18nfunctions = filters.values()
@@ -1,2540 +1,2550 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg add a
4 $ hg add a
5 $ echo line 1 > b
5 $ echo line 1 > b
6 $ echo line 2 >> b
6 $ echo line 2 >> b
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
8
8
9 $ hg add b
9 $ hg add b
10 $ echo other 1 > c
10 $ echo other 1 > c
11 $ echo other 2 >> c
11 $ echo other 2 >> c
12 $ echo >> c
12 $ echo >> c
13 $ echo other 3 >> c
13 $ echo other 3 >> c
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
15
15
16 $ hg add c
16 $ hg add c
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
18 $ echo c >> c
18 $ echo c >> c
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
20
20
21 $ echo foo > .hg/branch
21 $ echo foo > .hg/branch
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
23
23
24 $ hg co -q 3
24 $ hg co -q 3
25 $ echo other 4 >> d
25 $ echo other 4 >> d
26 $ hg add d
26 $ hg add d
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
28
28
29 $ hg merge -q foo
29 $ hg merge -q foo
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
31
31
32 Second branch starting at nullrev:
32 Second branch starting at nullrev:
33
33
34 $ hg update null
34 $ hg update null
35 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
35 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
36 $ echo second > second
36 $ echo second > second
37 $ hg add second
37 $ hg add second
38 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
38 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
39 created new head
39 created new head
40
40
41 $ echo third > third
41 $ echo third > third
42 $ hg add third
42 $ hg add third
43 $ hg mv second fourth
43 $ hg mv second fourth
44 $ hg commit -m third -d "2020-01-01 10:01"
44 $ hg commit -m third -d "2020-01-01 10:01"
45
45
46 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
46 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
47 fourth (second)
47 fourth (second)
48 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
48 $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
49 second -> fourth
49 second -> fourth
50 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
50 $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
51 8 t
51 8 t
52 7 f
52 7 f
53
53
54 Quoting for ui.logtemplate
54 Quoting for ui.logtemplate
55
55
56 $ hg tip --config "ui.logtemplate={rev}\n"
56 $ hg tip --config "ui.logtemplate={rev}\n"
57 8
57 8
58 $ hg tip --config "ui.logtemplate='{rev}\n'"
58 $ hg tip --config "ui.logtemplate='{rev}\n'"
59 8
59 8
60 $ hg tip --config 'ui.logtemplate="{rev}\n"'
60 $ hg tip --config 'ui.logtemplate="{rev}\n"'
61 8
61 8
62
62
63 Make sure user/global hgrc does not affect tests
63 Make sure user/global hgrc does not affect tests
64
64
65 $ echo '[ui]' > .hg/hgrc
65 $ echo '[ui]' > .hg/hgrc
66 $ echo 'logtemplate =' >> .hg/hgrc
66 $ echo 'logtemplate =' >> .hg/hgrc
67 $ echo 'style =' >> .hg/hgrc
67 $ echo 'style =' >> .hg/hgrc
68
68
69 Add some simple styles to settings
69 Add some simple styles to settings
70
70
71 $ echo '[templates]' >> .hg/hgrc
71 $ echo '[templates]' >> .hg/hgrc
72 $ printf 'simple = "{rev}\\n"\n' >> .hg/hgrc
72 $ printf 'simple = "{rev}\\n"\n' >> .hg/hgrc
73 $ printf 'simple2 = {rev}\\n\n' >> .hg/hgrc
73 $ printf 'simple2 = {rev}\\n\n' >> .hg/hgrc
74
74
75 $ hg log -l1 -Tsimple
75 $ hg log -l1 -Tsimple
76 8
76 8
77 $ hg log -l1 -Tsimple2
77 $ hg log -l1 -Tsimple2
78 8
78 8
79
79
80 Test templates and style maps in files:
80 Test templates and style maps in files:
81
81
82 $ echo "{rev}" > tmpl
82 $ echo "{rev}" > tmpl
83 $ hg log -l1 -T./tmpl
83 $ hg log -l1 -T./tmpl
84 8
84 8
85 $ hg log -l1 -Tblah/blah
85 $ hg log -l1 -Tblah/blah
86 blah/blah (no-eol)
86 blah/blah (no-eol)
87
87
88 $ printf 'changeset = "{rev}\\n"\n' > map-simple
88 $ printf 'changeset = "{rev}\\n"\n' > map-simple
89 $ hg log -l1 -T./map-simple
89 $ hg log -l1 -T./map-simple
90 8
90 8
91
91
92 Template should precede style option
92 Template should precede style option
93
93
94 $ hg log -l1 --style default -T '{rev}\n'
94 $ hg log -l1 --style default -T '{rev}\n'
95 8
95 8
96
96
97 Default style is like normal output:
97 Default style is like normal output:
98
98
99 $ hg log > log.out
99 $ hg log > log.out
100 $ hg log --style default > style.out
100 $ hg log --style default > style.out
101 $ cmp log.out style.out || diff -u log.out style.out
101 $ cmp log.out style.out || diff -u log.out style.out
102
102
103 $ hg log -v > log.out
103 $ hg log -v > log.out
104 $ hg log -v --style default > style.out
104 $ hg log -v --style default > style.out
105 $ cmp log.out style.out || diff -u log.out style.out
105 $ cmp log.out style.out || diff -u log.out style.out
106
106
107 $ hg log -q > log.out
107 $ hg log -q > log.out
108 $ hg log -q --style default > style.out
108 $ hg log -q --style default > style.out
109 $ cmp log.out style.out || diff -u log.out style.out
109 $ cmp log.out style.out || diff -u log.out style.out
110
110
111 $ hg log --debug > log.out
111 $ hg log --debug > log.out
112 $ hg log --debug --style default > style.out
112 $ hg log --debug --style default > style.out
113 $ cmp log.out style.out || diff -u log.out style.out
113 $ cmp log.out style.out || diff -u log.out style.out
114
114
115 Default style should also preserve color information (issue2866):
115 Default style should also preserve color information (issue2866):
116
116
117 $ cp $HGRCPATH $HGRCPATH-bak
117 $ cp $HGRCPATH $HGRCPATH-bak
118 $ cat <<EOF >> $HGRCPATH
118 $ cat <<EOF >> $HGRCPATH
119 > [extensions]
119 > [extensions]
120 > color=
120 > color=
121 > EOF
121 > EOF
122
122
123 $ hg --color=debug log > log.out
123 $ hg --color=debug log > log.out
124 $ hg --color=debug log --style default > style.out
124 $ hg --color=debug log --style default > style.out
125 $ cmp log.out style.out || diff -u log.out style.out
125 $ cmp log.out style.out || diff -u log.out style.out
126 $ hg --color=debug -v log > log.out
126 $ hg --color=debug -v log > log.out
127 $ hg --color=debug -v log --style default > style.out
127 $ hg --color=debug -v log --style default > style.out
128 $ cmp log.out style.out || diff -u log.out style.out
128 $ cmp log.out style.out || diff -u log.out style.out
129 $ hg --color=debug -q log > log.out
129 $ hg --color=debug -q log > log.out
130 $ hg --color=debug -q log --style default > style.out
130 $ hg --color=debug -q log --style default > style.out
131 $ cmp log.out style.out || diff -u log.out style.out
131 $ cmp log.out style.out || diff -u log.out style.out
132 $ hg --color=debug --debug log > log.out
132 $ hg --color=debug --debug log > log.out
133 $ hg --color=debug --debug log --style default > style.out
133 $ hg --color=debug --debug log --style default > style.out
134 $ cmp log.out style.out || diff -u log.out style.out
134 $ cmp log.out style.out || diff -u log.out style.out
135
135
136 $ mv $HGRCPATH-bak $HGRCPATH
136 $ mv $HGRCPATH-bak $HGRCPATH
137
137
138 Revision with no copies (used to print a traceback):
138 Revision with no copies (used to print a traceback):
139
139
140 $ hg tip -v --template '\n'
140 $ hg tip -v --template '\n'
141
141
142
142
143 Compact style works:
143 Compact style works:
144
144
145 $ hg log -Tcompact
145 $ hg log -Tcompact
146 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
146 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
147 third
147 third
148
148
149 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
149 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
150 second
150 second
151
151
152 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
152 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
153 merge
153 merge
154
154
155 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
155 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
156 new head
156 new head
157
157
158 4 bbe44766e73d 1970-01-17 04:53 +0000 person
158 4 bbe44766e73d 1970-01-17 04:53 +0000 person
159 new branch
159 new branch
160
160
161 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
161 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
162 no user, no domain
162 no user, no domain
163
163
164 2 97054abb4ab8 1970-01-14 21:20 +0000 other
164 2 97054abb4ab8 1970-01-14 21:20 +0000 other
165 no person
165 no person
166
166
167 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
167 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
168 other 1
168 other 1
169
169
170 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
170 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
171 line 1
171 line 1
172
172
173
173
174 $ hg log -v --style compact
174 $ hg log -v --style compact
175 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
175 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
176 third
176 third
177
177
178 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
178 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
179 second
179 second
180
180
181 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
181 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
182 merge
182 merge
183
183
184 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
184 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
185 new head
185 new head
186
186
187 4 bbe44766e73d 1970-01-17 04:53 +0000 person
187 4 bbe44766e73d 1970-01-17 04:53 +0000 person
188 new branch
188 new branch
189
189
190 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
190 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
191 no user, no domain
191 no user, no domain
192
192
193 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
193 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
194 no person
194 no person
195
195
196 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
196 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
197 other 1
197 other 1
198 other 2
198 other 2
199
199
200 other 3
200 other 3
201
201
202 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
202 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
203 line 1
203 line 1
204 line 2
204 line 2
205
205
206
206
207 $ hg log --debug --style compact
207 $ hg log --debug --style compact
208 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
208 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
209 third
209 third
210
210
211 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
211 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
212 second
212 second
213
213
214 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
214 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
215 merge
215 merge
216
216
217 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
217 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
218 new head
218 new head
219
219
220 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
220 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
221 new branch
221 new branch
222
222
223 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
223 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
224 no user, no domain
224 no user, no domain
225
225
226 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
226 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
227 no person
227 no person
228
228
229 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
229 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
230 other 1
230 other 1
231 other 2
231 other 2
232
232
233 other 3
233 other 3
234
234
235 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
235 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
236 line 1
236 line 1
237 line 2
237 line 2
238
238
239
239
240 Test xml styles:
240 Test xml styles:
241
241
242 $ hg log --style xml
242 $ hg log --style xml
243 <?xml version="1.0"?>
243 <?xml version="1.0"?>
244 <log>
244 <log>
245 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
245 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
246 <tag>tip</tag>
246 <tag>tip</tag>
247 <author email="test">test</author>
247 <author email="test">test</author>
248 <date>2020-01-01T10:01:00+00:00</date>
248 <date>2020-01-01T10:01:00+00:00</date>
249 <msg xml:space="preserve">third</msg>
249 <msg xml:space="preserve">third</msg>
250 </logentry>
250 </logentry>
251 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
251 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
252 <parent revision="-1" node="0000000000000000000000000000000000000000" />
252 <parent revision="-1" node="0000000000000000000000000000000000000000" />
253 <author email="user@hostname">User Name</author>
253 <author email="user@hostname">User Name</author>
254 <date>1970-01-12T13:46:40+00:00</date>
254 <date>1970-01-12T13:46:40+00:00</date>
255 <msg xml:space="preserve">second</msg>
255 <msg xml:space="preserve">second</msg>
256 </logentry>
256 </logentry>
257 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
257 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
258 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
258 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
259 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
259 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
260 <author email="person">person</author>
260 <author email="person">person</author>
261 <date>1970-01-18T08:40:01+00:00</date>
261 <date>1970-01-18T08:40:01+00:00</date>
262 <msg xml:space="preserve">merge</msg>
262 <msg xml:space="preserve">merge</msg>
263 </logentry>
263 </logentry>
264 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
264 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
265 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
265 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
266 <author email="person">person</author>
266 <author email="person">person</author>
267 <date>1970-01-18T08:40:00+00:00</date>
267 <date>1970-01-18T08:40:00+00:00</date>
268 <msg xml:space="preserve">new head</msg>
268 <msg xml:space="preserve">new head</msg>
269 </logentry>
269 </logentry>
270 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
270 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
271 <branch>foo</branch>
271 <branch>foo</branch>
272 <author email="person">person</author>
272 <author email="person">person</author>
273 <date>1970-01-17T04:53:20+00:00</date>
273 <date>1970-01-17T04:53:20+00:00</date>
274 <msg xml:space="preserve">new branch</msg>
274 <msg xml:space="preserve">new branch</msg>
275 </logentry>
275 </logentry>
276 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
276 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
277 <author email="person">person</author>
277 <author email="person">person</author>
278 <date>1970-01-16T01:06:40+00:00</date>
278 <date>1970-01-16T01:06:40+00:00</date>
279 <msg xml:space="preserve">no user, no domain</msg>
279 <msg xml:space="preserve">no user, no domain</msg>
280 </logentry>
280 </logentry>
281 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
281 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
282 <author email="other@place">other</author>
282 <author email="other@place">other</author>
283 <date>1970-01-14T21:20:00+00:00</date>
283 <date>1970-01-14T21:20:00+00:00</date>
284 <msg xml:space="preserve">no person</msg>
284 <msg xml:space="preserve">no person</msg>
285 </logentry>
285 </logentry>
286 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
286 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
287 <author email="other@place">A. N. Other</author>
287 <author email="other@place">A. N. Other</author>
288 <date>1970-01-13T17:33:20+00:00</date>
288 <date>1970-01-13T17:33:20+00:00</date>
289 <msg xml:space="preserve">other 1
289 <msg xml:space="preserve">other 1
290 other 2
290 other 2
291
291
292 other 3</msg>
292 other 3</msg>
293 </logentry>
293 </logentry>
294 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
294 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
295 <author email="user@hostname">User Name</author>
295 <author email="user@hostname">User Name</author>
296 <date>1970-01-12T13:46:40+00:00</date>
296 <date>1970-01-12T13:46:40+00:00</date>
297 <msg xml:space="preserve">line 1
297 <msg xml:space="preserve">line 1
298 line 2</msg>
298 line 2</msg>
299 </logentry>
299 </logentry>
300 </log>
300 </log>
301
301
302 $ hg log -v --style xml
302 $ hg log -v --style xml
303 <?xml version="1.0"?>
303 <?xml version="1.0"?>
304 <log>
304 <log>
305 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
305 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
306 <tag>tip</tag>
306 <tag>tip</tag>
307 <author email="test">test</author>
307 <author email="test">test</author>
308 <date>2020-01-01T10:01:00+00:00</date>
308 <date>2020-01-01T10:01:00+00:00</date>
309 <msg xml:space="preserve">third</msg>
309 <msg xml:space="preserve">third</msg>
310 <paths>
310 <paths>
311 <path action="A">fourth</path>
311 <path action="A">fourth</path>
312 <path action="A">third</path>
312 <path action="A">third</path>
313 <path action="R">second</path>
313 <path action="R">second</path>
314 </paths>
314 </paths>
315 <copies>
315 <copies>
316 <copy source="second">fourth</copy>
316 <copy source="second">fourth</copy>
317 </copies>
317 </copies>
318 </logentry>
318 </logentry>
319 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
319 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
320 <parent revision="-1" node="0000000000000000000000000000000000000000" />
320 <parent revision="-1" node="0000000000000000000000000000000000000000" />
321 <author email="user@hostname">User Name</author>
321 <author email="user@hostname">User Name</author>
322 <date>1970-01-12T13:46:40+00:00</date>
322 <date>1970-01-12T13:46:40+00:00</date>
323 <msg xml:space="preserve">second</msg>
323 <msg xml:space="preserve">second</msg>
324 <paths>
324 <paths>
325 <path action="A">second</path>
325 <path action="A">second</path>
326 </paths>
326 </paths>
327 </logentry>
327 </logentry>
328 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
328 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
329 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
329 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
330 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
330 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
331 <author email="person">person</author>
331 <author email="person">person</author>
332 <date>1970-01-18T08:40:01+00:00</date>
332 <date>1970-01-18T08:40:01+00:00</date>
333 <msg xml:space="preserve">merge</msg>
333 <msg xml:space="preserve">merge</msg>
334 <paths>
334 <paths>
335 </paths>
335 </paths>
336 </logentry>
336 </logentry>
337 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
337 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
338 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
338 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
339 <author email="person">person</author>
339 <author email="person">person</author>
340 <date>1970-01-18T08:40:00+00:00</date>
340 <date>1970-01-18T08:40:00+00:00</date>
341 <msg xml:space="preserve">new head</msg>
341 <msg xml:space="preserve">new head</msg>
342 <paths>
342 <paths>
343 <path action="A">d</path>
343 <path action="A">d</path>
344 </paths>
344 </paths>
345 </logentry>
345 </logentry>
346 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
346 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
347 <branch>foo</branch>
347 <branch>foo</branch>
348 <author email="person">person</author>
348 <author email="person">person</author>
349 <date>1970-01-17T04:53:20+00:00</date>
349 <date>1970-01-17T04:53:20+00:00</date>
350 <msg xml:space="preserve">new branch</msg>
350 <msg xml:space="preserve">new branch</msg>
351 <paths>
351 <paths>
352 </paths>
352 </paths>
353 </logentry>
353 </logentry>
354 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
354 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
355 <author email="person">person</author>
355 <author email="person">person</author>
356 <date>1970-01-16T01:06:40+00:00</date>
356 <date>1970-01-16T01:06:40+00:00</date>
357 <msg xml:space="preserve">no user, no domain</msg>
357 <msg xml:space="preserve">no user, no domain</msg>
358 <paths>
358 <paths>
359 <path action="M">c</path>
359 <path action="M">c</path>
360 </paths>
360 </paths>
361 </logentry>
361 </logentry>
362 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
362 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
363 <author email="other@place">other</author>
363 <author email="other@place">other</author>
364 <date>1970-01-14T21:20:00+00:00</date>
364 <date>1970-01-14T21:20:00+00:00</date>
365 <msg xml:space="preserve">no person</msg>
365 <msg xml:space="preserve">no person</msg>
366 <paths>
366 <paths>
367 <path action="A">c</path>
367 <path action="A">c</path>
368 </paths>
368 </paths>
369 </logentry>
369 </logentry>
370 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
370 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
371 <author email="other@place">A. N. Other</author>
371 <author email="other@place">A. N. Other</author>
372 <date>1970-01-13T17:33:20+00:00</date>
372 <date>1970-01-13T17:33:20+00:00</date>
373 <msg xml:space="preserve">other 1
373 <msg xml:space="preserve">other 1
374 other 2
374 other 2
375
375
376 other 3</msg>
376 other 3</msg>
377 <paths>
377 <paths>
378 <path action="A">b</path>
378 <path action="A">b</path>
379 </paths>
379 </paths>
380 </logentry>
380 </logentry>
381 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
381 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
382 <author email="user@hostname">User Name</author>
382 <author email="user@hostname">User Name</author>
383 <date>1970-01-12T13:46:40+00:00</date>
383 <date>1970-01-12T13:46:40+00:00</date>
384 <msg xml:space="preserve">line 1
384 <msg xml:space="preserve">line 1
385 line 2</msg>
385 line 2</msg>
386 <paths>
386 <paths>
387 <path action="A">a</path>
387 <path action="A">a</path>
388 </paths>
388 </paths>
389 </logentry>
389 </logentry>
390 </log>
390 </log>
391
391
392 $ hg log --debug --style xml
392 $ hg log --debug --style xml
393 <?xml version="1.0"?>
393 <?xml version="1.0"?>
394 <log>
394 <log>
395 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
395 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
396 <tag>tip</tag>
396 <tag>tip</tag>
397 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
397 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
398 <parent revision="-1" node="0000000000000000000000000000000000000000" />
398 <parent revision="-1" node="0000000000000000000000000000000000000000" />
399 <author email="test">test</author>
399 <author email="test">test</author>
400 <date>2020-01-01T10:01:00+00:00</date>
400 <date>2020-01-01T10:01:00+00:00</date>
401 <msg xml:space="preserve">third</msg>
401 <msg xml:space="preserve">third</msg>
402 <paths>
402 <paths>
403 <path action="A">fourth</path>
403 <path action="A">fourth</path>
404 <path action="A">third</path>
404 <path action="A">third</path>
405 <path action="R">second</path>
405 <path action="R">second</path>
406 </paths>
406 </paths>
407 <copies>
407 <copies>
408 <copy source="second">fourth</copy>
408 <copy source="second">fourth</copy>
409 </copies>
409 </copies>
410 <extra key="branch">default</extra>
410 <extra key="branch">default</extra>
411 </logentry>
411 </logentry>
412 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
412 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
413 <parent revision="-1" node="0000000000000000000000000000000000000000" />
413 <parent revision="-1" node="0000000000000000000000000000000000000000" />
414 <parent revision="-1" node="0000000000000000000000000000000000000000" />
414 <parent revision="-1" node="0000000000000000000000000000000000000000" />
415 <author email="user@hostname">User Name</author>
415 <author email="user@hostname">User Name</author>
416 <date>1970-01-12T13:46:40+00:00</date>
416 <date>1970-01-12T13:46:40+00:00</date>
417 <msg xml:space="preserve">second</msg>
417 <msg xml:space="preserve">second</msg>
418 <paths>
418 <paths>
419 <path action="A">second</path>
419 <path action="A">second</path>
420 </paths>
420 </paths>
421 <extra key="branch">default</extra>
421 <extra key="branch">default</extra>
422 </logentry>
422 </logentry>
423 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
423 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
424 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
424 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
425 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
425 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
426 <author email="person">person</author>
426 <author email="person">person</author>
427 <date>1970-01-18T08:40:01+00:00</date>
427 <date>1970-01-18T08:40:01+00:00</date>
428 <msg xml:space="preserve">merge</msg>
428 <msg xml:space="preserve">merge</msg>
429 <paths>
429 <paths>
430 </paths>
430 </paths>
431 <extra key="branch">default</extra>
431 <extra key="branch">default</extra>
432 </logentry>
432 </logentry>
433 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
433 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
434 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
434 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
435 <parent revision="-1" node="0000000000000000000000000000000000000000" />
435 <parent revision="-1" node="0000000000000000000000000000000000000000" />
436 <author email="person">person</author>
436 <author email="person">person</author>
437 <date>1970-01-18T08:40:00+00:00</date>
437 <date>1970-01-18T08:40:00+00:00</date>
438 <msg xml:space="preserve">new head</msg>
438 <msg xml:space="preserve">new head</msg>
439 <paths>
439 <paths>
440 <path action="A">d</path>
440 <path action="A">d</path>
441 </paths>
441 </paths>
442 <extra key="branch">default</extra>
442 <extra key="branch">default</extra>
443 </logentry>
443 </logentry>
444 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
444 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
445 <branch>foo</branch>
445 <branch>foo</branch>
446 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
446 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
447 <parent revision="-1" node="0000000000000000000000000000000000000000" />
447 <parent revision="-1" node="0000000000000000000000000000000000000000" />
448 <author email="person">person</author>
448 <author email="person">person</author>
449 <date>1970-01-17T04:53:20+00:00</date>
449 <date>1970-01-17T04:53:20+00:00</date>
450 <msg xml:space="preserve">new branch</msg>
450 <msg xml:space="preserve">new branch</msg>
451 <paths>
451 <paths>
452 </paths>
452 </paths>
453 <extra key="branch">foo</extra>
453 <extra key="branch">foo</extra>
454 </logentry>
454 </logentry>
455 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
455 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
456 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
456 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
457 <parent revision="-1" node="0000000000000000000000000000000000000000" />
457 <parent revision="-1" node="0000000000000000000000000000000000000000" />
458 <author email="person">person</author>
458 <author email="person">person</author>
459 <date>1970-01-16T01:06:40+00:00</date>
459 <date>1970-01-16T01:06:40+00:00</date>
460 <msg xml:space="preserve">no user, no domain</msg>
460 <msg xml:space="preserve">no user, no domain</msg>
461 <paths>
461 <paths>
462 <path action="M">c</path>
462 <path action="M">c</path>
463 </paths>
463 </paths>
464 <extra key="branch">default</extra>
464 <extra key="branch">default</extra>
465 </logentry>
465 </logentry>
466 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
466 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
467 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
467 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
468 <parent revision="-1" node="0000000000000000000000000000000000000000" />
468 <parent revision="-1" node="0000000000000000000000000000000000000000" />
469 <author email="other@place">other</author>
469 <author email="other@place">other</author>
470 <date>1970-01-14T21:20:00+00:00</date>
470 <date>1970-01-14T21:20:00+00:00</date>
471 <msg xml:space="preserve">no person</msg>
471 <msg xml:space="preserve">no person</msg>
472 <paths>
472 <paths>
473 <path action="A">c</path>
473 <path action="A">c</path>
474 </paths>
474 </paths>
475 <extra key="branch">default</extra>
475 <extra key="branch">default</extra>
476 </logentry>
476 </logentry>
477 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
477 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
478 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
478 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
479 <parent revision="-1" node="0000000000000000000000000000000000000000" />
479 <parent revision="-1" node="0000000000000000000000000000000000000000" />
480 <author email="other@place">A. N. Other</author>
480 <author email="other@place">A. N. Other</author>
481 <date>1970-01-13T17:33:20+00:00</date>
481 <date>1970-01-13T17:33:20+00:00</date>
482 <msg xml:space="preserve">other 1
482 <msg xml:space="preserve">other 1
483 other 2
483 other 2
484
484
485 other 3</msg>
485 other 3</msg>
486 <paths>
486 <paths>
487 <path action="A">b</path>
487 <path action="A">b</path>
488 </paths>
488 </paths>
489 <extra key="branch">default</extra>
489 <extra key="branch">default</extra>
490 </logentry>
490 </logentry>
491 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
491 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
492 <parent revision="-1" node="0000000000000000000000000000000000000000" />
492 <parent revision="-1" node="0000000000000000000000000000000000000000" />
493 <parent revision="-1" node="0000000000000000000000000000000000000000" />
493 <parent revision="-1" node="0000000000000000000000000000000000000000" />
494 <author email="user@hostname">User Name</author>
494 <author email="user@hostname">User Name</author>
495 <date>1970-01-12T13:46:40+00:00</date>
495 <date>1970-01-12T13:46:40+00:00</date>
496 <msg xml:space="preserve">line 1
496 <msg xml:space="preserve">line 1
497 line 2</msg>
497 line 2</msg>
498 <paths>
498 <paths>
499 <path action="A">a</path>
499 <path action="A">a</path>
500 </paths>
500 </paths>
501 <extra key="branch">default</extra>
501 <extra key="branch">default</extra>
502 </logentry>
502 </logentry>
503 </log>
503 </log>
504
504
505
505
506 Test JSON style:
506 Test JSON style:
507
507
508 $ hg log -k nosuch -Tjson
508 $ hg log -k nosuch -Tjson
509 []
509 []
510
510
511 $ hg log -qr . -Tjson
511 $ hg log -qr . -Tjson
512 [
512 [
513 {
513 {
514 "rev": 8,
514 "rev": 8,
515 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
515 "node": "95c24699272ef57d062b8bccc32c878bf841784a"
516 }
516 }
517 ]
517 ]
518
518
519 $ hg log -vpr . -Tjson --stat
519 $ hg log -vpr . -Tjson --stat
520 [
520 [
521 {
521 {
522 "rev": 8,
522 "rev": 8,
523 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
523 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
524 "branch": "default",
524 "branch": "default",
525 "phase": "draft",
525 "phase": "draft",
526 "user": "test",
526 "user": "test",
527 "date": [1577872860, 0],
527 "date": [1577872860, 0],
528 "desc": "third",
528 "desc": "third",
529 "bookmarks": [],
529 "bookmarks": [],
530 "tags": ["tip"],
530 "tags": ["tip"],
531 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
531 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
532 "files": ["fourth", "second", "third"],
532 "files": ["fourth", "second", "third"],
533 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
533 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
534 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n"
534 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n"
535 }
535 }
536 ]
536 ]
537
537
538 honor --git but not format-breaking diffopts
538 honor --git but not format-breaking diffopts
539 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
539 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
540 [
540 [
541 {
541 {
542 "rev": 8,
542 "rev": 8,
543 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
543 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
544 "branch": "default",
544 "branch": "default",
545 "phase": "draft",
545 "phase": "draft",
546 "user": "test",
546 "user": "test",
547 "date": [1577872860, 0],
547 "date": [1577872860, 0],
548 "desc": "third",
548 "desc": "third",
549 "bookmarks": [],
549 "bookmarks": [],
550 "tags": ["tip"],
550 "tags": ["tip"],
551 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
551 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
552 "files": ["fourth", "second", "third"],
552 "files": ["fourth", "second", "third"],
553 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n"
553 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n"
554 }
554 }
555 ]
555 ]
556
556
557 $ hg log -T json
557 $ hg log -T json
558 [
558 [
559 {
559 {
560 "rev": 8,
560 "rev": 8,
561 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
561 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
562 "branch": "default",
562 "branch": "default",
563 "phase": "draft",
563 "phase": "draft",
564 "user": "test",
564 "user": "test",
565 "date": [1577872860, 0],
565 "date": [1577872860, 0],
566 "desc": "third",
566 "desc": "third",
567 "bookmarks": [],
567 "bookmarks": [],
568 "tags": ["tip"],
568 "tags": ["tip"],
569 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
569 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"]
570 },
570 },
571 {
571 {
572 "rev": 7,
572 "rev": 7,
573 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
573 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
574 "branch": "default",
574 "branch": "default",
575 "phase": "draft",
575 "phase": "draft",
576 "user": "User Name <user@hostname>",
576 "user": "User Name <user@hostname>",
577 "date": [1000000, 0],
577 "date": [1000000, 0],
578 "desc": "second",
578 "desc": "second",
579 "bookmarks": [],
579 "bookmarks": [],
580 "tags": [],
580 "tags": [],
581 "parents": ["0000000000000000000000000000000000000000"]
581 "parents": ["0000000000000000000000000000000000000000"]
582 },
582 },
583 {
583 {
584 "rev": 6,
584 "rev": 6,
585 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
585 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
586 "branch": "default",
586 "branch": "default",
587 "phase": "draft",
587 "phase": "draft",
588 "user": "person",
588 "user": "person",
589 "date": [1500001, 0],
589 "date": [1500001, 0],
590 "desc": "merge",
590 "desc": "merge",
591 "bookmarks": [],
591 "bookmarks": [],
592 "tags": [],
592 "tags": [],
593 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
593 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"]
594 },
594 },
595 {
595 {
596 "rev": 5,
596 "rev": 5,
597 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
597 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
598 "branch": "default",
598 "branch": "default",
599 "phase": "draft",
599 "phase": "draft",
600 "user": "person",
600 "user": "person",
601 "date": [1500000, 0],
601 "date": [1500000, 0],
602 "desc": "new head",
602 "desc": "new head",
603 "bookmarks": [],
603 "bookmarks": [],
604 "tags": [],
604 "tags": [],
605 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
605 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
606 },
606 },
607 {
607 {
608 "rev": 4,
608 "rev": 4,
609 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
609 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
610 "branch": "foo",
610 "branch": "foo",
611 "phase": "draft",
611 "phase": "draft",
612 "user": "person",
612 "user": "person",
613 "date": [1400000, 0],
613 "date": [1400000, 0],
614 "desc": "new branch",
614 "desc": "new branch",
615 "bookmarks": [],
615 "bookmarks": [],
616 "tags": [],
616 "tags": [],
617 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
617 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"]
618 },
618 },
619 {
619 {
620 "rev": 3,
620 "rev": 3,
621 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
621 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
622 "branch": "default",
622 "branch": "default",
623 "phase": "draft",
623 "phase": "draft",
624 "user": "person",
624 "user": "person",
625 "date": [1300000, 0],
625 "date": [1300000, 0],
626 "desc": "no user, no domain",
626 "desc": "no user, no domain",
627 "bookmarks": [],
627 "bookmarks": [],
628 "tags": [],
628 "tags": [],
629 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
629 "parents": ["97054abb4ab824450e9164180baf491ae0078465"]
630 },
630 },
631 {
631 {
632 "rev": 2,
632 "rev": 2,
633 "node": "97054abb4ab824450e9164180baf491ae0078465",
633 "node": "97054abb4ab824450e9164180baf491ae0078465",
634 "branch": "default",
634 "branch": "default",
635 "phase": "draft",
635 "phase": "draft",
636 "user": "other@place",
636 "user": "other@place",
637 "date": [1200000, 0],
637 "date": [1200000, 0],
638 "desc": "no person",
638 "desc": "no person",
639 "bookmarks": [],
639 "bookmarks": [],
640 "tags": [],
640 "tags": [],
641 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
641 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"]
642 },
642 },
643 {
643 {
644 "rev": 1,
644 "rev": 1,
645 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
645 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
646 "branch": "default",
646 "branch": "default",
647 "phase": "draft",
647 "phase": "draft",
648 "user": "A. N. Other <other@place>",
648 "user": "A. N. Other <other@place>",
649 "date": [1100000, 0],
649 "date": [1100000, 0],
650 "desc": "other 1\nother 2\n\nother 3",
650 "desc": "other 1\nother 2\n\nother 3",
651 "bookmarks": [],
651 "bookmarks": [],
652 "tags": [],
652 "tags": [],
653 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
653 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"]
654 },
654 },
655 {
655 {
656 "rev": 0,
656 "rev": 0,
657 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
657 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
658 "branch": "default",
658 "branch": "default",
659 "phase": "draft",
659 "phase": "draft",
660 "user": "User Name <user@hostname>",
660 "user": "User Name <user@hostname>",
661 "date": [1000000, 0],
661 "date": [1000000, 0],
662 "desc": "line 1\nline 2",
662 "desc": "line 1\nline 2",
663 "bookmarks": [],
663 "bookmarks": [],
664 "tags": [],
664 "tags": [],
665 "parents": ["0000000000000000000000000000000000000000"]
665 "parents": ["0000000000000000000000000000000000000000"]
666 }
666 }
667 ]
667 ]
668
668
669 $ hg heads -v -Tjson
669 $ hg heads -v -Tjson
670 [
670 [
671 {
671 {
672 "rev": 8,
672 "rev": 8,
673 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
673 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
674 "branch": "default",
674 "branch": "default",
675 "phase": "draft",
675 "phase": "draft",
676 "user": "test",
676 "user": "test",
677 "date": [1577872860, 0],
677 "date": [1577872860, 0],
678 "desc": "third",
678 "desc": "third",
679 "bookmarks": [],
679 "bookmarks": [],
680 "tags": ["tip"],
680 "tags": ["tip"],
681 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
681 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
682 "files": ["fourth", "second", "third"]
682 "files": ["fourth", "second", "third"]
683 },
683 },
684 {
684 {
685 "rev": 6,
685 "rev": 6,
686 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
686 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
687 "branch": "default",
687 "branch": "default",
688 "phase": "draft",
688 "phase": "draft",
689 "user": "person",
689 "user": "person",
690 "date": [1500001, 0],
690 "date": [1500001, 0],
691 "desc": "merge",
691 "desc": "merge",
692 "bookmarks": [],
692 "bookmarks": [],
693 "tags": [],
693 "tags": [],
694 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
694 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
695 "files": []
695 "files": []
696 },
696 },
697 {
697 {
698 "rev": 4,
698 "rev": 4,
699 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
699 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
700 "branch": "foo",
700 "branch": "foo",
701 "phase": "draft",
701 "phase": "draft",
702 "user": "person",
702 "user": "person",
703 "date": [1400000, 0],
703 "date": [1400000, 0],
704 "desc": "new branch",
704 "desc": "new branch",
705 "bookmarks": [],
705 "bookmarks": [],
706 "tags": [],
706 "tags": [],
707 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
707 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
708 "files": []
708 "files": []
709 }
709 }
710 ]
710 ]
711
711
712 $ hg log --debug -Tjson
712 $ hg log --debug -Tjson
713 [
713 [
714 {
714 {
715 "rev": 8,
715 "rev": 8,
716 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
716 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
717 "branch": "default",
717 "branch": "default",
718 "phase": "draft",
718 "phase": "draft",
719 "user": "test",
719 "user": "test",
720 "date": [1577872860, 0],
720 "date": [1577872860, 0],
721 "desc": "third",
721 "desc": "third",
722 "bookmarks": [],
722 "bookmarks": [],
723 "tags": ["tip"],
723 "tags": ["tip"],
724 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
724 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
725 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
725 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
726 "extra": {"branch": "default"},
726 "extra": {"branch": "default"},
727 "modified": [],
727 "modified": [],
728 "added": ["fourth", "third"],
728 "added": ["fourth", "third"],
729 "removed": ["second"]
729 "removed": ["second"]
730 },
730 },
731 {
731 {
732 "rev": 7,
732 "rev": 7,
733 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
733 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
734 "branch": "default",
734 "branch": "default",
735 "phase": "draft",
735 "phase": "draft",
736 "user": "User Name <user@hostname>",
736 "user": "User Name <user@hostname>",
737 "date": [1000000, 0],
737 "date": [1000000, 0],
738 "desc": "second",
738 "desc": "second",
739 "bookmarks": [],
739 "bookmarks": [],
740 "tags": [],
740 "tags": [],
741 "parents": ["0000000000000000000000000000000000000000"],
741 "parents": ["0000000000000000000000000000000000000000"],
742 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
742 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
743 "extra": {"branch": "default"},
743 "extra": {"branch": "default"},
744 "modified": [],
744 "modified": [],
745 "added": ["second"],
745 "added": ["second"],
746 "removed": []
746 "removed": []
747 },
747 },
748 {
748 {
749 "rev": 6,
749 "rev": 6,
750 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
750 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
751 "branch": "default",
751 "branch": "default",
752 "phase": "draft",
752 "phase": "draft",
753 "user": "person",
753 "user": "person",
754 "date": [1500001, 0],
754 "date": [1500001, 0],
755 "desc": "merge",
755 "desc": "merge",
756 "bookmarks": [],
756 "bookmarks": [],
757 "tags": [],
757 "tags": [],
758 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
758 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
759 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
759 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
760 "extra": {"branch": "default"},
760 "extra": {"branch": "default"},
761 "modified": [],
761 "modified": [],
762 "added": [],
762 "added": [],
763 "removed": []
763 "removed": []
764 },
764 },
765 {
765 {
766 "rev": 5,
766 "rev": 5,
767 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
767 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
768 "branch": "default",
768 "branch": "default",
769 "phase": "draft",
769 "phase": "draft",
770 "user": "person",
770 "user": "person",
771 "date": [1500000, 0],
771 "date": [1500000, 0],
772 "desc": "new head",
772 "desc": "new head",
773 "bookmarks": [],
773 "bookmarks": [],
774 "tags": [],
774 "tags": [],
775 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
775 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
776 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
776 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
777 "extra": {"branch": "default"},
777 "extra": {"branch": "default"},
778 "modified": [],
778 "modified": [],
779 "added": ["d"],
779 "added": ["d"],
780 "removed": []
780 "removed": []
781 },
781 },
782 {
782 {
783 "rev": 4,
783 "rev": 4,
784 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
784 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
785 "branch": "foo",
785 "branch": "foo",
786 "phase": "draft",
786 "phase": "draft",
787 "user": "person",
787 "user": "person",
788 "date": [1400000, 0],
788 "date": [1400000, 0],
789 "desc": "new branch",
789 "desc": "new branch",
790 "bookmarks": [],
790 "bookmarks": [],
791 "tags": [],
791 "tags": [],
792 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
792 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
793 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
793 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
794 "extra": {"branch": "foo"},
794 "extra": {"branch": "foo"},
795 "modified": [],
795 "modified": [],
796 "added": [],
796 "added": [],
797 "removed": []
797 "removed": []
798 },
798 },
799 {
799 {
800 "rev": 3,
800 "rev": 3,
801 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
801 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
802 "branch": "default",
802 "branch": "default",
803 "phase": "draft",
803 "phase": "draft",
804 "user": "person",
804 "user": "person",
805 "date": [1300000, 0],
805 "date": [1300000, 0],
806 "desc": "no user, no domain",
806 "desc": "no user, no domain",
807 "bookmarks": [],
807 "bookmarks": [],
808 "tags": [],
808 "tags": [],
809 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
809 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
810 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
810 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
811 "extra": {"branch": "default"},
811 "extra": {"branch": "default"},
812 "modified": ["c"],
812 "modified": ["c"],
813 "added": [],
813 "added": [],
814 "removed": []
814 "removed": []
815 },
815 },
816 {
816 {
817 "rev": 2,
817 "rev": 2,
818 "node": "97054abb4ab824450e9164180baf491ae0078465",
818 "node": "97054abb4ab824450e9164180baf491ae0078465",
819 "branch": "default",
819 "branch": "default",
820 "phase": "draft",
820 "phase": "draft",
821 "user": "other@place",
821 "user": "other@place",
822 "date": [1200000, 0],
822 "date": [1200000, 0],
823 "desc": "no person",
823 "desc": "no person",
824 "bookmarks": [],
824 "bookmarks": [],
825 "tags": [],
825 "tags": [],
826 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
826 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
827 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
827 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
828 "extra": {"branch": "default"},
828 "extra": {"branch": "default"},
829 "modified": [],
829 "modified": [],
830 "added": ["c"],
830 "added": ["c"],
831 "removed": []
831 "removed": []
832 },
832 },
833 {
833 {
834 "rev": 1,
834 "rev": 1,
835 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
835 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
836 "branch": "default",
836 "branch": "default",
837 "phase": "draft",
837 "phase": "draft",
838 "user": "A. N. Other <other@place>",
838 "user": "A. N. Other <other@place>",
839 "date": [1100000, 0],
839 "date": [1100000, 0],
840 "desc": "other 1\nother 2\n\nother 3",
840 "desc": "other 1\nother 2\n\nother 3",
841 "bookmarks": [],
841 "bookmarks": [],
842 "tags": [],
842 "tags": [],
843 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
843 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
844 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
844 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
845 "extra": {"branch": "default"},
845 "extra": {"branch": "default"},
846 "modified": [],
846 "modified": [],
847 "added": ["b"],
847 "added": ["b"],
848 "removed": []
848 "removed": []
849 },
849 },
850 {
850 {
851 "rev": 0,
851 "rev": 0,
852 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
852 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
853 "branch": "default",
853 "branch": "default",
854 "phase": "draft",
854 "phase": "draft",
855 "user": "User Name <user@hostname>",
855 "user": "User Name <user@hostname>",
856 "date": [1000000, 0],
856 "date": [1000000, 0],
857 "desc": "line 1\nline 2",
857 "desc": "line 1\nline 2",
858 "bookmarks": [],
858 "bookmarks": [],
859 "tags": [],
859 "tags": [],
860 "parents": ["0000000000000000000000000000000000000000"],
860 "parents": ["0000000000000000000000000000000000000000"],
861 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
861 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
862 "extra": {"branch": "default"},
862 "extra": {"branch": "default"},
863 "modified": [],
863 "modified": [],
864 "added": ["a"],
864 "added": ["a"],
865 "removed": []
865 "removed": []
866 }
866 }
867 ]
867 ]
868
868
869 Error if style not readable:
869 Error if style not readable:
870
870
871 #if unix-permissions no-root
871 #if unix-permissions no-root
872 $ touch q
872 $ touch q
873 $ chmod 0 q
873 $ chmod 0 q
874 $ hg log --style ./q
874 $ hg log --style ./q
875 abort: Permission denied: ./q
875 abort: Permission denied: ./q
876 [255]
876 [255]
877 #endif
877 #endif
878
878
879 Error if no style:
879 Error if no style:
880
880
881 $ hg log --style notexist
881 $ hg log --style notexist
882 abort: style 'notexist' not found
882 abort: style 'notexist' not found
883 (available styles: bisect, changelog, compact, default, phases, xml)
883 (available styles: bisect, changelog, compact, default, phases, xml)
884 [255]
884 [255]
885
885
886 $ hg log -T list
886 $ hg log -T list
887 available styles: bisect, changelog, compact, default, phases, xml
887 available styles: bisect, changelog, compact, default, phases, xml
888 abort: specify a template
888 abort: specify a template
889 [255]
889 [255]
890
890
891 Error if style missing key:
891 Error if style missing key:
892
892
893 $ echo 'q = q' > t
893 $ echo 'q = q' > t
894 $ hg log --style ./t
894 $ hg log --style ./t
895 abort: "changeset" not in template map
895 abort: "changeset" not in template map
896 [255]
896 [255]
897
897
898 Error if style missing value:
898 Error if style missing value:
899
899
900 $ echo 'changeset =' > t
900 $ echo 'changeset =' > t
901 $ hg log --style t
901 $ hg log --style t
902 abort: t:1: missing value
902 abort: t:1: missing value
903 [255]
903 [255]
904
904
905 Error if include fails:
905 Error if include fails:
906
906
907 $ echo 'changeset = q' >> t
907 $ echo 'changeset = q' >> t
908 #if unix-permissions no-root
908 #if unix-permissions no-root
909 $ hg log --style ./t
909 $ hg log --style ./t
910 abort: template file ./q: Permission denied
910 abort: template file ./q: Permission denied
911 [255]
911 [255]
912 $ rm q
912 $ rm q
913 #endif
913 #endif
914
914
915 Include works:
915 Include works:
916
916
917 $ echo '{rev}' > q
917 $ echo '{rev}' > q
918 $ hg log --style ./t
918 $ hg log --style ./t
919 8
919 8
920 7
920 7
921 6
921 6
922 5
922 5
923 4
923 4
924 3
924 3
925 2
925 2
926 1
926 1
927 0
927 0
928
928
929 Check that {phase} works correctly on parents:
929 Check that {phase} works correctly on parents:
930
930
931 $ cat << EOF > parentphase
931 $ cat << EOF > parentphase
932 > changeset_debug = '{rev} ({phase}):{parents}\n'
932 > changeset_debug = '{rev} ({phase}):{parents}\n'
933 > parent = ' {rev} ({phase})'
933 > parent = ' {rev} ({phase})'
934 > EOF
934 > EOF
935 $ hg phase -r 5 --public
935 $ hg phase -r 5 --public
936 $ hg phase -r 7 --secret --force
936 $ hg phase -r 7 --secret --force
937 $ hg log --debug -G --style ./parentphase
937 $ hg log --debug -G --style ./parentphase
938 @ 8 (secret): 7 (secret) -1 (public)
938 @ 8 (secret): 7 (secret) -1 (public)
939 |
939 |
940 o 7 (secret): -1 (public) -1 (public)
940 o 7 (secret): -1 (public) -1 (public)
941
941
942 o 6 (draft): 5 (public) 4 (draft)
942 o 6 (draft): 5 (public) 4 (draft)
943 |\
943 |\
944 | o 5 (public): 3 (public) -1 (public)
944 | o 5 (public): 3 (public) -1 (public)
945 | |
945 | |
946 o | 4 (draft): 3 (public) -1 (public)
946 o | 4 (draft): 3 (public) -1 (public)
947 |/
947 |/
948 o 3 (public): 2 (public) -1 (public)
948 o 3 (public): 2 (public) -1 (public)
949 |
949 |
950 o 2 (public): 1 (public) -1 (public)
950 o 2 (public): 1 (public) -1 (public)
951 |
951 |
952 o 1 (public): 0 (public) -1 (public)
952 o 1 (public): 0 (public) -1 (public)
953 |
953 |
954 o 0 (public): -1 (public) -1 (public)
954 o 0 (public): -1 (public) -1 (public)
955
955
956
956
957 Missing non-standard names give no error (backward compatibility):
957 Missing non-standard names give no error (backward compatibility):
958
958
959 $ echo "changeset = '{c}'" > t
959 $ echo "changeset = '{c}'" > t
960 $ hg log --style ./t
960 $ hg log --style ./t
961
961
962 Defining non-standard name works:
962 Defining non-standard name works:
963
963
964 $ cat <<EOF > t
964 $ cat <<EOF > t
965 > changeset = '{c}'
965 > changeset = '{c}'
966 > c = q
966 > c = q
967 > EOF
967 > EOF
968 $ hg log --style ./t
968 $ hg log --style ./t
969 8
969 8
970 7
970 7
971 6
971 6
972 5
972 5
973 4
973 4
974 3
974 3
975 2
975 2
976 1
976 1
977 0
977 0
978
978
979 ui.style works:
979 ui.style works:
980
980
981 $ echo '[ui]' > .hg/hgrc
981 $ echo '[ui]' > .hg/hgrc
982 $ echo 'style = t' >> .hg/hgrc
982 $ echo 'style = t' >> .hg/hgrc
983 $ hg log
983 $ hg log
984 8
984 8
985 7
985 7
986 6
986 6
987 5
987 5
988 4
988 4
989 3
989 3
990 2
990 2
991 1
991 1
992 0
992 0
993
993
994
994
995 Issue338:
995 Issue338:
996
996
997 $ hg log --style=changelog > changelog
997 $ hg log --style=changelog > changelog
998
998
999 $ cat changelog
999 $ cat changelog
1000 2020-01-01 test <test>
1000 2020-01-01 test <test>
1001
1001
1002 * fourth, second, third:
1002 * fourth, second, third:
1003 third
1003 third
1004 [95c24699272e] [tip]
1004 [95c24699272e] [tip]
1005
1005
1006 1970-01-12 User Name <user@hostname>
1006 1970-01-12 User Name <user@hostname>
1007
1007
1008 * second:
1008 * second:
1009 second
1009 second
1010 [29114dbae42b]
1010 [29114dbae42b]
1011
1011
1012 1970-01-18 person <person>
1012 1970-01-18 person <person>
1013
1013
1014 * merge
1014 * merge
1015 [d41e714fe50d]
1015 [d41e714fe50d]
1016
1016
1017 * d:
1017 * d:
1018 new head
1018 new head
1019 [13207e5a10d9]
1019 [13207e5a10d9]
1020
1020
1021 1970-01-17 person <person>
1021 1970-01-17 person <person>
1022
1022
1023 * new branch
1023 * new branch
1024 [bbe44766e73d] <foo>
1024 [bbe44766e73d] <foo>
1025
1025
1026 1970-01-16 person <person>
1026 1970-01-16 person <person>
1027
1027
1028 * c:
1028 * c:
1029 no user, no domain
1029 no user, no domain
1030 [10e46f2dcbf4]
1030 [10e46f2dcbf4]
1031
1031
1032 1970-01-14 other <other@place>
1032 1970-01-14 other <other@place>
1033
1033
1034 * c:
1034 * c:
1035 no person
1035 no person
1036 [97054abb4ab8]
1036 [97054abb4ab8]
1037
1037
1038 1970-01-13 A. N. Other <other@place>
1038 1970-01-13 A. N. Other <other@place>
1039
1039
1040 * b:
1040 * b:
1041 other 1 other 2
1041 other 1 other 2
1042
1042
1043 other 3
1043 other 3
1044 [b608e9d1a3f0]
1044 [b608e9d1a3f0]
1045
1045
1046 1970-01-12 User Name <user@hostname>
1046 1970-01-12 User Name <user@hostname>
1047
1047
1048 * a:
1048 * a:
1049 line 1 line 2
1049 line 1 line 2
1050 [1e4e1b8f71e0]
1050 [1e4e1b8f71e0]
1051
1051
1052
1052
1053 Issue2130: xml output for 'hg heads' is malformed
1053 Issue2130: xml output for 'hg heads' is malformed
1054
1054
1055 $ hg heads --style changelog
1055 $ hg heads --style changelog
1056 2020-01-01 test <test>
1056 2020-01-01 test <test>
1057
1057
1058 * fourth, second, third:
1058 * fourth, second, third:
1059 third
1059 third
1060 [95c24699272e] [tip]
1060 [95c24699272e] [tip]
1061
1061
1062 1970-01-18 person <person>
1062 1970-01-18 person <person>
1063
1063
1064 * merge
1064 * merge
1065 [d41e714fe50d]
1065 [d41e714fe50d]
1066
1066
1067 1970-01-17 person <person>
1067 1970-01-17 person <person>
1068
1068
1069 * new branch
1069 * new branch
1070 [bbe44766e73d] <foo>
1070 [bbe44766e73d] <foo>
1071
1071
1072
1072
1073 Keys work:
1073 Keys work:
1074
1074
1075 $ for key in author branch branches date desc file_adds file_dels file_mods \
1075 $ for key in author branch branches date desc file_adds file_dels file_mods \
1076 > file_copies file_copies_switch files \
1076 > file_copies file_copies_switch files \
1077 > manifest node parents rev tags diffstat extras \
1077 > manifest node parents rev tags diffstat extras \
1078 > p1rev p2rev p1node p2node; do
1078 > p1rev p2rev p1node p2node; do
1079 > for mode in '' --verbose --debug; do
1079 > for mode in '' --verbose --debug; do
1080 > hg log $mode --template "$key$mode: {$key}\n"
1080 > hg log $mode --template "$key$mode: {$key}\n"
1081 > done
1081 > done
1082 > done
1082 > done
1083 author: test
1083 author: test
1084 author: User Name <user@hostname>
1084 author: User Name <user@hostname>
1085 author: person
1085 author: person
1086 author: person
1086 author: person
1087 author: person
1087 author: person
1088 author: person
1088 author: person
1089 author: other@place
1089 author: other@place
1090 author: A. N. Other <other@place>
1090 author: A. N. Other <other@place>
1091 author: User Name <user@hostname>
1091 author: User Name <user@hostname>
1092 author--verbose: test
1092 author--verbose: test
1093 author--verbose: User Name <user@hostname>
1093 author--verbose: User Name <user@hostname>
1094 author--verbose: person
1094 author--verbose: person
1095 author--verbose: person
1095 author--verbose: person
1096 author--verbose: person
1096 author--verbose: person
1097 author--verbose: person
1097 author--verbose: person
1098 author--verbose: other@place
1098 author--verbose: other@place
1099 author--verbose: A. N. Other <other@place>
1099 author--verbose: A. N. Other <other@place>
1100 author--verbose: User Name <user@hostname>
1100 author--verbose: User Name <user@hostname>
1101 author--debug: test
1101 author--debug: test
1102 author--debug: User Name <user@hostname>
1102 author--debug: User Name <user@hostname>
1103 author--debug: person
1103 author--debug: person
1104 author--debug: person
1104 author--debug: person
1105 author--debug: person
1105 author--debug: person
1106 author--debug: person
1106 author--debug: person
1107 author--debug: other@place
1107 author--debug: other@place
1108 author--debug: A. N. Other <other@place>
1108 author--debug: A. N. Other <other@place>
1109 author--debug: User Name <user@hostname>
1109 author--debug: User Name <user@hostname>
1110 branch: default
1110 branch: default
1111 branch: default
1111 branch: default
1112 branch: default
1112 branch: default
1113 branch: default
1113 branch: default
1114 branch: foo
1114 branch: foo
1115 branch: default
1115 branch: default
1116 branch: default
1116 branch: default
1117 branch: default
1117 branch: default
1118 branch: default
1118 branch: default
1119 branch--verbose: default
1119 branch--verbose: default
1120 branch--verbose: default
1120 branch--verbose: default
1121 branch--verbose: default
1121 branch--verbose: default
1122 branch--verbose: default
1122 branch--verbose: default
1123 branch--verbose: foo
1123 branch--verbose: foo
1124 branch--verbose: default
1124 branch--verbose: default
1125 branch--verbose: default
1125 branch--verbose: default
1126 branch--verbose: default
1126 branch--verbose: default
1127 branch--verbose: default
1127 branch--verbose: default
1128 branch--debug: default
1128 branch--debug: default
1129 branch--debug: default
1129 branch--debug: default
1130 branch--debug: default
1130 branch--debug: default
1131 branch--debug: default
1131 branch--debug: default
1132 branch--debug: foo
1132 branch--debug: foo
1133 branch--debug: default
1133 branch--debug: default
1134 branch--debug: default
1134 branch--debug: default
1135 branch--debug: default
1135 branch--debug: default
1136 branch--debug: default
1136 branch--debug: default
1137 branches:
1137 branches:
1138 branches:
1138 branches:
1139 branches:
1139 branches:
1140 branches:
1140 branches:
1141 branches: foo
1141 branches: foo
1142 branches:
1142 branches:
1143 branches:
1143 branches:
1144 branches:
1144 branches:
1145 branches:
1145 branches:
1146 branches--verbose:
1146 branches--verbose:
1147 branches--verbose:
1147 branches--verbose:
1148 branches--verbose:
1148 branches--verbose:
1149 branches--verbose:
1149 branches--verbose:
1150 branches--verbose: foo
1150 branches--verbose: foo
1151 branches--verbose:
1151 branches--verbose:
1152 branches--verbose:
1152 branches--verbose:
1153 branches--verbose:
1153 branches--verbose:
1154 branches--verbose:
1154 branches--verbose:
1155 branches--debug:
1155 branches--debug:
1156 branches--debug:
1156 branches--debug:
1157 branches--debug:
1157 branches--debug:
1158 branches--debug:
1158 branches--debug:
1159 branches--debug: foo
1159 branches--debug: foo
1160 branches--debug:
1160 branches--debug:
1161 branches--debug:
1161 branches--debug:
1162 branches--debug:
1162 branches--debug:
1163 branches--debug:
1163 branches--debug:
1164 date: 1577872860.00
1164 date: 1577872860.00
1165 date: 1000000.00
1165 date: 1000000.00
1166 date: 1500001.00
1166 date: 1500001.00
1167 date: 1500000.00
1167 date: 1500000.00
1168 date: 1400000.00
1168 date: 1400000.00
1169 date: 1300000.00
1169 date: 1300000.00
1170 date: 1200000.00
1170 date: 1200000.00
1171 date: 1100000.00
1171 date: 1100000.00
1172 date: 1000000.00
1172 date: 1000000.00
1173 date--verbose: 1577872860.00
1173 date--verbose: 1577872860.00
1174 date--verbose: 1000000.00
1174 date--verbose: 1000000.00
1175 date--verbose: 1500001.00
1175 date--verbose: 1500001.00
1176 date--verbose: 1500000.00
1176 date--verbose: 1500000.00
1177 date--verbose: 1400000.00
1177 date--verbose: 1400000.00
1178 date--verbose: 1300000.00
1178 date--verbose: 1300000.00
1179 date--verbose: 1200000.00
1179 date--verbose: 1200000.00
1180 date--verbose: 1100000.00
1180 date--verbose: 1100000.00
1181 date--verbose: 1000000.00
1181 date--verbose: 1000000.00
1182 date--debug: 1577872860.00
1182 date--debug: 1577872860.00
1183 date--debug: 1000000.00
1183 date--debug: 1000000.00
1184 date--debug: 1500001.00
1184 date--debug: 1500001.00
1185 date--debug: 1500000.00
1185 date--debug: 1500000.00
1186 date--debug: 1400000.00
1186 date--debug: 1400000.00
1187 date--debug: 1300000.00
1187 date--debug: 1300000.00
1188 date--debug: 1200000.00
1188 date--debug: 1200000.00
1189 date--debug: 1100000.00
1189 date--debug: 1100000.00
1190 date--debug: 1000000.00
1190 date--debug: 1000000.00
1191 desc: third
1191 desc: third
1192 desc: second
1192 desc: second
1193 desc: merge
1193 desc: merge
1194 desc: new head
1194 desc: new head
1195 desc: new branch
1195 desc: new branch
1196 desc: no user, no domain
1196 desc: no user, no domain
1197 desc: no person
1197 desc: no person
1198 desc: other 1
1198 desc: other 1
1199 other 2
1199 other 2
1200
1200
1201 other 3
1201 other 3
1202 desc: line 1
1202 desc: line 1
1203 line 2
1203 line 2
1204 desc--verbose: third
1204 desc--verbose: third
1205 desc--verbose: second
1205 desc--verbose: second
1206 desc--verbose: merge
1206 desc--verbose: merge
1207 desc--verbose: new head
1207 desc--verbose: new head
1208 desc--verbose: new branch
1208 desc--verbose: new branch
1209 desc--verbose: no user, no domain
1209 desc--verbose: no user, no domain
1210 desc--verbose: no person
1210 desc--verbose: no person
1211 desc--verbose: other 1
1211 desc--verbose: other 1
1212 other 2
1212 other 2
1213
1213
1214 other 3
1214 other 3
1215 desc--verbose: line 1
1215 desc--verbose: line 1
1216 line 2
1216 line 2
1217 desc--debug: third
1217 desc--debug: third
1218 desc--debug: second
1218 desc--debug: second
1219 desc--debug: merge
1219 desc--debug: merge
1220 desc--debug: new head
1220 desc--debug: new head
1221 desc--debug: new branch
1221 desc--debug: new branch
1222 desc--debug: no user, no domain
1222 desc--debug: no user, no domain
1223 desc--debug: no person
1223 desc--debug: no person
1224 desc--debug: other 1
1224 desc--debug: other 1
1225 other 2
1225 other 2
1226
1226
1227 other 3
1227 other 3
1228 desc--debug: line 1
1228 desc--debug: line 1
1229 line 2
1229 line 2
1230 file_adds: fourth third
1230 file_adds: fourth third
1231 file_adds: second
1231 file_adds: second
1232 file_adds:
1232 file_adds:
1233 file_adds: d
1233 file_adds: d
1234 file_adds:
1234 file_adds:
1235 file_adds:
1235 file_adds:
1236 file_adds: c
1236 file_adds: c
1237 file_adds: b
1237 file_adds: b
1238 file_adds: a
1238 file_adds: a
1239 file_adds--verbose: fourth third
1239 file_adds--verbose: fourth third
1240 file_adds--verbose: second
1240 file_adds--verbose: second
1241 file_adds--verbose:
1241 file_adds--verbose:
1242 file_adds--verbose: d
1242 file_adds--verbose: d
1243 file_adds--verbose:
1243 file_adds--verbose:
1244 file_adds--verbose:
1244 file_adds--verbose:
1245 file_adds--verbose: c
1245 file_adds--verbose: c
1246 file_adds--verbose: b
1246 file_adds--verbose: b
1247 file_adds--verbose: a
1247 file_adds--verbose: a
1248 file_adds--debug: fourth third
1248 file_adds--debug: fourth third
1249 file_adds--debug: second
1249 file_adds--debug: second
1250 file_adds--debug:
1250 file_adds--debug:
1251 file_adds--debug: d
1251 file_adds--debug: d
1252 file_adds--debug:
1252 file_adds--debug:
1253 file_adds--debug:
1253 file_adds--debug:
1254 file_adds--debug: c
1254 file_adds--debug: c
1255 file_adds--debug: b
1255 file_adds--debug: b
1256 file_adds--debug: a
1256 file_adds--debug: a
1257 file_dels: second
1257 file_dels: second
1258 file_dels:
1258 file_dels:
1259 file_dels:
1259 file_dels:
1260 file_dels:
1260 file_dels:
1261 file_dels:
1261 file_dels:
1262 file_dels:
1262 file_dels:
1263 file_dels:
1263 file_dels:
1264 file_dels:
1264 file_dels:
1265 file_dels:
1265 file_dels:
1266 file_dels--verbose: second
1266 file_dels--verbose: second
1267 file_dels--verbose:
1267 file_dels--verbose:
1268 file_dels--verbose:
1268 file_dels--verbose:
1269 file_dels--verbose:
1269 file_dels--verbose:
1270 file_dels--verbose:
1270 file_dels--verbose:
1271 file_dels--verbose:
1271 file_dels--verbose:
1272 file_dels--verbose:
1272 file_dels--verbose:
1273 file_dels--verbose:
1273 file_dels--verbose:
1274 file_dels--verbose:
1274 file_dels--verbose:
1275 file_dels--debug: second
1275 file_dels--debug: second
1276 file_dels--debug:
1276 file_dels--debug:
1277 file_dels--debug:
1277 file_dels--debug:
1278 file_dels--debug:
1278 file_dels--debug:
1279 file_dels--debug:
1279 file_dels--debug:
1280 file_dels--debug:
1280 file_dels--debug:
1281 file_dels--debug:
1281 file_dels--debug:
1282 file_dels--debug:
1282 file_dels--debug:
1283 file_dels--debug:
1283 file_dels--debug:
1284 file_mods:
1284 file_mods:
1285 file_mods:
1285 file_mods:
1286 file_mods:
1286 file_mods:
1287 file_mods:
1287 file_mods:
1288 file_mods:
1288 file_mods:
1289 file_mods: c
1289 file_mods: c
1290 file_mods:
1290 file_mods:
1291 file_mods:
1291 file_mods:
1292 file_mods:
1292 file_mods:
1293 file_mods--verbose:
1293 file_mods--verbose:
1294 file_mods--verbose:
1294 file_mods--verbose:
1295 file_mods--verbose:
1295 file_mods--verbose:
1296 file_mods--verbose:
1296 file_mods--verbose:
1297 file_mods--verbose:
1297 file_mods--verbose:
1298 file_mods--verbose: c
1298 file_mods--verbose: c
1299 file_mods--verbose:
1299 file_mods--verbose:
1300 file_mods--verbose:
1300 file_mods--verbose:
1301 file_mods--verbose:
1301 file_mods--verbose:
1302 file_mods--debug:
1302 file_mods--debug:
1303 file_mods--debug:
1303 file_mods--debug:
1304 file_mods--debug:
1304 file_mods--debug:
1305 file_mods--debug:
1305 file_mods--debug:
1306 file_mods--debug:
1306 file_mods--debug:
1307 file_mods--debug: c
1307 file_mods--debug: c
1308 file_mods--debug:
1308 file_mods--debug:
1309 file_mods--debug:
1309 file_mods--debug:
1310 file_mods--debug:
1310 file_mods--debug:
1311 file_copies: fourth (second)
1311 file_copies: fourth (second)
1312 file_copies:
1312 file_copies:
1313 file_copies:
1313 file_copies:
1314 file_copies:
1314 file_copies:
1315 file_copies:
1315 file_copies:
1316 file_copies:
1316 file_copies:
1317 file_copies:
1317 file_copies:
1318 file_copies:
1318 file_copies:
1319 file_copies:
1319 file_copies:
1320 file_copies--verbose: fourth (second)
1320 file_copies--verbose: fourth (second)
1321 file_copies--verbose:
1321 file_copies--verbose:
1322 file_copies--verbose:
1322 file_copies--verbose:
1323 file_copies--verbose:
1323 file_copies--verbose:
1324 file_copies--verbose:
1324 file_copies--verbose:
1325 file_copies--verbose:
1325 file_copies--verbose:
1326 file_copies--verbose:
1326 file_copies--verbose:
1327 file_copies--verbose:
1327 file_copies--verbose:
1328 file_copies--verbose:
1328 file_copies--verbose:
1329 file_copies--debug: fourth (second)
1329 file_copies--debug: fourth (second)
1330 file_copies--debug:
1330 file_copies--debug:
1331 file_copies--debug:
1331 file_copies--debug:
1332 file_copies--debug:
1332 file_copies--debug:
1333 file_copies--debug:
1333 file_copies--debug:
1334 file_copies--debug:
1334 file_copies--debug:
1335 file_copies--debug:
1335 file_copies--debug:
1336 file_copies--debug:
1336 file_copies--debug:
1337 file_copies--debug:
1337 file_copies--debug:
1338 file_copies_switch:
1338 file_copies_switch:
1339 file_copies_switch:
1339 file_copies_switch:
1340 file_copies_switch:
1340 file_copies_switch:
1341 file_copies_switch:
1341 file_copies_switch:
1342 file_copies_switch:
1342 file_copies_switch:
1343 file_copies_switch:
1343 file_copies_switch:
1344 file_copies_switch:
1344 file_copies_switch:
1345 file_copies_switch:
1345 file_copies_switch:
1346 file_copies_switch:
1346 file_copies_switch:
1347 file_copies_switch--verbose:
1347 file_copies_switch--verbose:
1348 file_copies_switch--verbose:
1348 file_copies_switch--verbose:
1349 file_copies_switch--verbose:
1349 file_copies_switch--verbose:
1350 file_copies_switch--verbose:
1350 file_copies_switch--verbose:
1351 file_copies_switch--verbose:
1351 file_copies_switch--verbose:
1352 file_copies_switch--verbose:
1352 file_copies_switch--verbose:
1353 file_copies_switch--verbose:
1353 file_copies_switch--verbose:
1354 file_copies_switch--verbose:
1354 file_copies_switch--verbose:
1355 file_copies_switch--verbose:
1355 file_copies_switch--verbose:
1356 file_copies_switch--debug:
1356 file_copies_switch--debug:
1357 file_copies_switch--debug:
1357 file_copies_switch--debug:
1358 file_copies_switch--debug:
1358 file_copies_switch--debug:
1359 file_copies_switch--debug:
1359 file_copies_switch--debug:
1360 file_copies_switch--debug:
1360 file_copies_switch--debug:
1361 file_copies_switch--debug:
1361 file_copies_switch--debug:
1362 file_copies_switch--debug:
1362 file_copies_switch--debug:
1363 file_copies_switch--debug:
1363 file_copies_switch--debug:
1364 file_copies_switch--debug:
1364 file_copies_switch--debug:
1365 files: fourth second third
1365 files: fourth second third
1366 files: second
1366 files: second
1367 files:
1367 files:
1368 files: d
1368 files: d
1369 files:
1369 files:
1370 files: c
1370 files: c
1371 files: c
1371 files: c
1372 files: b
1372 files: b
1373 files: a
1373 files: a
1374 files--verbose: fourth second third
1374 files--verbose: fourth second third
1375 files--verbose: second
1375 files--verbose: second
1376 files--verbose:
1376 files--verbose:
1377 files--verbose: d
1377 files--verbose: d
1378 files--verbose:
1378 files--verbose:
1379 files--verbose: c
1379 files--verbose: c
1380 files--verbose: c
1380 files--verbose: c
1381 files--verbose: b
1381 files--verbose: b
1382 files--verbose: a
1382 files--verbose: a
1383 files--debug: fourth second third
1383 files--debug: fourth second third
1384 files--debug: second
1384 files--debug: second
1385 files--debug:
1385 files--debug:
1386 files--debug: d
1386 files--debug: d
1387 files--debug:
1387 files--debug:
1388 files--debug: c
1388 files--debug: c
1389 files--debug: c
1389 files--debug: c
1390 files--debug: b
1390 files--debug: b
1391 files--debug: a
1391 files--debug: a
1392 manifest: 6:94961b75a2da
1392 manifest: 6:94961b75a2da
1393 manifest: 5:f2dbc354b94e
1393 manifest: 5:f2dbc354b94e
1394 manifest: 4:4dc3def4f9b4
1394 manifest: 4:4dc3def4f9b4
1395 manifest: 4:4dc3def4f9b4
1395 manifest: 4:4dc3def4f9b4
1396 manifest: 3:cb5a1327723b
1396 manifest: 3:cb5a1327723b
1397 manifest: 3:cb5a1327723b
1397 manifest: 3:cb5a1327723b
1398 manifest: 2:6e0e82995c35
1398 manifest: 2:6e0e82995c35
1399 manifest: 1:4e8d705b1e53
1399 manifest: 1:4e8d705b1e53
1400 manifest: 0:a0c8bcbbb45c
1400 manifest: 0:a0c8bcbbb45c
1401 manifest--verbose: 6:94961b75a2da
1401 manifest--verbose: 6:94961b75a2da
1402 manifest--verbose: 5:f2dbc354b94e
1402 manifest--verbose: 5:f2dbc354b94e
1403 manifest--verbose: 4:4dc3def4f9b4
1403 manifest--verbose: 4:4dc3def4f9b4
1404 manifest--verbose: 4:4dc3def4f9b4
1404 manifest--verbose: 4:4dc3def4f9b4
1405 manifest--verbose: 3:cb5a1327723b
1405 manifest--verbose: 3:cb5a1327723b
1406 manifest--verbose: 3:cb5a1327723b
1406 manifest--verbose: 3:cb5a1327723b
1407 manifest--verbose: 2:6e0e82995c35
1407 manifest--verbose: 2:6e0e82995c35
1408 manifest--verbose: 1:4e8d705b1e53
1408 manifest--verbose: 1:4e8d705b1e53
1409 manifest--verbose: 0:a0c8bcbbb45c
1409 manifest--verbose: 0:a0c8bcbbb45c
1410 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1410 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
1411 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1411 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
1412 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1412 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1413 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1413 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
1414 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1414 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1415 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1415 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1416 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1416 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1417 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1417 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1418 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1418 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1419 node: 95c24699272ef57d062b8bccc32c878bf841784a
1419 node: 95c24699272ef57d062b8bccc32c878bf841784a
1420 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1420 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1421 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1421 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1422 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1422 node: 13207e5a10d9fd28ec424934298e176197f2c67f
1423 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1423 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1424 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1424 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1425 node: 97054abb4ab824450e9164180baf491ae0078465
1425 node: 97054abb4ab824450e9164180baf491ae0078465
1426 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1426 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1427 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1427 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1428 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1428 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
1429 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1429 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1430 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1430 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1431 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1431 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1432 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1432 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1433 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1433 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1434 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1434 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1435 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1435 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1436 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1436 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1437 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1437 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
1438 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1438 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1439 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1439 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
1440 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1440 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1441 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1441 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1442 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1442 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1443 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1443 node--debug: 97054abb4ab824450e9164180baf491ae0078465
1444 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1444 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1445 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1445 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1446 parents:
1446 parents:
1447 parents: -1:000000000000
1447 parents: -1:000000000000
1448 parents: 5:13207e5a10d9 4:bbe44766e73d
1448 parents: 5:13207e5a10d9 4:bbe44766e73d
1449 parents: 3:10e46f2dcbf4
1449 parents: 3:10e46f2dcbf4
1450 parents:
1450 parents:
1451 parents:
1451 parents:
1452 parents:
1452 parents:
1453 parents:
1453 parents:
1454 parents:
1454 parents:
1455 parents--verbose:
1455 parents--verbose:
1456 parents--verbose: -1:000000000000
1456 parents--verbose: -1:000000000000
1457 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1457 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
1458 parents--verbose: 3:10e46f2dcbf4
1458 parents--verbose: 3:10e46f2dcbf4
1459 parents--verbose:
1459 parents--verbose:
1460 parents--verbose:
1460 parents--verbose:
1461 parents--verbose:
1461 parents--verbose:
1462 parents--verbose:
1462 parents--verbose:
1463 parents--verbose:
1463 parents--verbose:
1464 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1464 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
1465 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1465 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1466 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1466 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1467 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1467 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1468 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1468 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
1469 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1469 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
1470 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1470 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
1471 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1471 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
1472 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1472 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
1473 rev: 8
1473 rev: 8
1474 rev: 7
1474 rev: 7
1475 rev: 6
1475 rev: 6
1476 rev: 5
1476 rev: 5
1477 rev: 4
1477 rev: 4
1478 rev: 3
1478 rev: 3
1479 rev: 2
1479 rev: 2
1480 rev: 1
1480 rev: 1
1481 rev: 0
1481 rev: 0
1482 rev--verbose: 8
1482 rev--verbose: 8
1483 rev--verbose: 7
1483 rev--verbose: 7
1484 rev--verbose: 6
1484 rev--verbose: 6
1485 rev--verbose: 5
1485 rev--verbose: 5
1486 rev--verbose: 4
1486 rev--verbose: 4
1487 rev--verbose: 3
1487 rev--verbose: 3
1488 rev--verbose: 2
1488 rev--verbose: 2
1489 rev--verbose: 1
1489 rev--verbose: 1
1490 rev--verbose: 0
1490 rev--verbose: 0
1491 rev--debug: 8
1491 rev--debug: 8
1492 rev--debug: 7
1492 rev--debug: 7
1493 rev--debug: 6
1493 rev--debug: 6
1494 rev--debug: 5
1494 rev--debug: 5
1495 rev--debug: 4
1495 rev--debug: 4
1496 rev--debug: 3
1496 rev--debug: 3
1497 rev--debug: 2
1497 rev--debug: 2
1498 rev--debug: 1
1498 rev--debug: 1
1499 rev--debug: 0
1499 rev--debug: 0
1500 tags: tip
1500 tags: tip
1501 tags:
1501 tags:
1502 tags:
1502 tags:
1503 tags:
1503 tags:
1504 tags:
1504 tags:
1505 tags:
1505 tags:
1506 tags:
1506 tags:
1507 tags:
1507 tags:
1508 tags:
1508 tags:
1509 tags--verbose: tip
1509 tags--verbose: tip
1510 tags--verbose:
1510 tags--verbose:
1511 tags--verbose:
1511 tags--verbose:
1512 tags--verbose:
1512 tags--verbose:
1513 tags--verbose:
1513 tags--verbose:
1514 tags--verbose:
1514 tags--verbose:
1515 tags--verbose:
1515 tags--verbose:
1516 tags--verbose:
1516 tags--verbose:
1517 tags--verbose:
1517 tags--verbose:
1518 tags--debug: tip
1518 tags--debug: tip
1519 tags--debug:
1519 tags--debug:
1520 tags--debug:
1520 tags--debug:
1521 tags--debug:
1521 tags--debug:
1522 tags--debug:
1522 tags--debug:
1523 tags--debug:
1523 tags--debug:
1524 tags--debug:
1524 tags--debug:
1525 tags--debug:
1525 tags--debug:
1526 tags--debug:
1526 tags--debug:
1527 diffstat: 3: +2/-1
1527 diffstat: 3: +2/-1
1528 diffstat: 1: +1/-0
1528 diffstat: 1: +1/-0
1529 diffstat: 0: +0/-0
1529 diffstat: 0: +0/-0
1530 diffstat: 1: +1/-0
1530 diffstat: 1: +1/-0
1531 diffstat: 0: +0/-0
1531 diffstat: 0: +0/-0
1532 diffstat: 1: +1/-0
1532 diffstat: 1: +1/-0
1533 diffstat: 1: +4/-0
1533 diffstat: 1: +4/-0
1534 diffstat: 1: +2/-0
1534 diffstat: 1: +2/-0
1535 diffstat: 1: +1/-0
1535 diffstat: 1: +1/-0
1536 diffstat--verbose: 3: +2/-1
1536 diffstat--verbose: 3: +2/-1
1537 diffstat--verbose: 1: +1/-0
1537 diffstat--verbose: 1: +1/-0
1538 diffstat--verbose: 0: +0/-0
1538 diffstat--verbose: 0: +0/-0
1539 diffstat--verbose: 1: +1/-0
1539 diffstat--verbose: 1: +1/-0
1540 diffstat--verbose: 0: +0/-0
1540 diffstat--verbose: 0: +0/-0
1541 diffstat--verbose: 1: +1/-0
1541 diffstat--verbose: 1: +1/-0
1542 diffstat--verbose: 1: +4/-0
1542 diffstat--verbose: 1: +4/-0
1543 diffstat--verbose: 1: +2/-0
1543 diffstat--verbose: 1: +2/-0
1544 diffstat--verbose: 1: +1/-0
1544 diffstat--verbose: 1: +1/-0
1545 diffstat--debug: 3: +2/-1
1545 diffstat--debug: 3: +2/-1
1546 diffstat--debug: 1: +1/-0
1546 diffstat--debug: 1: +1/-0
1547 diffstat--debug: 0: +0/-0
1547 diffstat--debug: 0: +0/-0
1548 diffstat--debug: 1: +1/-0
1548 diffstat--debug: 1: +1/-0
1549 diffstat--debug: 0: +0/-0
1549 diffstat--debug: 0: +0/-0
1550 diffstat--debug: 1: +1/-0
1550 diffstat--debug: 1: +1/-0
1551 diffstat--debug: 1: +4/-0
1551 diffstat--debug: 1: +4/-0
1552 diffstat--debug: 1: +2/-0
1552 diffstat--debug: 1: +2/-0
1553 diffstat--debug: 1: +1/-0
1553 diffstat--debug: 1: +1/-0
1554 extras: branch=default
1554 extras: branch=default
1555 extras: branch=default
1555 extras: branch=default
1556 extras: branch=default
1556 extras: branch=default
1557 extras: branch=default
1557 extras: branch=default
1558 extras: branch=foo
1558 extras: branch=foo
1559 extras: branch=default
1559 extras: branch=default
1560 extras: branch=default
1560 extras: branch=default
1561 extras: branch=default
1561 extras: branch=default
1562 extras: branch=default
1562 extras: branch=default
1563 extras--verbose: branch=default
1563 extras--verbose: branch=default
1564 extras--verbose: branch=default
1564 extras--verbose: branch=default
1565 extras--verbose: branch=default
1565 extras--verbose: branch=default
1566 extras--verbose: branch=default
1566 extras--verbose: branch=default
1567 extras--verbose: branch=foo
1567 extras--verbose: branch=foo
1568 extras--verbose: branch=default
1568 extras--verbose: branch=default
1569 extras--verbose: branch=default
1569 extras--verbose: branch=default
1570 extras--verbose: branch=default
1570 extras--verbose: branch=default
1571 extras--verbose: branch=default
1571 extras--verbose: branch=default
1572 extras--debug: branch=default
1572 extras--debug: branch=default
1573 extras--debug: branch=default
1573 extras--debug: branch=default
1574 extras--debug: branch=default
1574 extras--debug: branch=default
1575 extras--debug: branch=default
1575 extras--debug: branch=default
1576 extras--debug: branch=foo
1576 extras--debug: branch=foo
1577 extras--debug: branch=default
1577 extras--debug: branch=default
1578 extras--debug: branch=default
1578 extras--debug: branch=default
1579 extras--debug: branch=default
1579 extras--debug: branch=default
1580 extras--debug: branch=default
1580 extras--debug: branch=default
1581 p1rev: 7
1581 p1rev: 7
1582 p1rev: -1
1582 p1rev: -1
1583 p1rev: 5
1583 p1rev: 5
1584 p1rev: 3
1584 p1rev: 3
1585 p1rev: 3
1585 p1rev: 3
1586 p1rev: 2
1586 p1rev: 2
1587 p1rev: 1
1587 p1rev: 1
1588 p1rev: 0
1588 p1rev: 0
1589 p1rev: -1
1589 p1rev: -1
1590 p1rev--verbose: 7
1590 p1rev--verbose: 7
1591 p1rev--verbose: -1
1591 p1rev--verbose: -1
1592 p1rev--verbose: 5
1592 p1rev--verbose: 5
1593 p1rev--verbose: 3
1593 p1rev--verbose: 3
1594 p1rev--verbose: 3
1594 p1rev--verbose: 3
1595 p1rev--verbose: 2
1595 p1rev--verbose: 2
1596 p1rev--verbose: 1
1596 p1rev--verbose: 1
1597 p1rev--verbose: 0
1597 p1rev--verbose: 0
1598 p1rev--verbose: -1
1598 p1rev--verbose: -1
1599 p1rev--debug: 7
1599 p1rev--debug: 7
1600 p1rev--debug: -1
1600 p1rev--debug: -1
1601 p1rev--debug: 5
1601 p1rev--debug: 5
1602 p1rev--debug: 3
1602 p1rev--debug: 3
1603 p1rev--debug: 3
1603 p1rev--debug: 3
1604 p1rev--debug: 2
1604 p1rev--debug: 2
1605 p1rev--debug: 1
1605 p1rev--debug: 1
1606 p1rev--debug: 0
1606 p1rev--debug: 0
1607 p1rev--debug: -1
1607 p1rev--debug: -1
1608 p2rev: -1
1608 p2rev: -1
1609 p2rev: -1
1609 p2rev: -1
1610 p2rev: 4
1610 p2rev: 4
1611 p2rev: -1
1611 p2rev: -1
1612 p2rev: -1
1612 p2rev: -1
1613 p2rev: -1
1613 p2rev: -1
1614 p2rev: -1
1614 p2rev: -1
1615 p2rev: -1
1615 p2rev: -1
1616 p2rev: -1
1616 p2rev: -1
1617 p2rev--verbose: -1
1617 p2rev--verbose: -1
1618 p2rev--verbose: -1
1618 p2rev--verbose: -1
1619 p2rev--verbose: 4
1619 p2rev--verbose: 4
1620 p2rev--verbose: -1
1620 p2rev--verbose: -1
1621 p2rev--verbose: -1
1621 p2rev--verbose: -1
1622 p2rev--verbose: -1
1622 p2rev--verbose: -1
1623 p2rev--verbose: -1
1623 p2rev--verbose: -1
1624 p2rev--verbose: -1
1624 p2rev--verbose: -1
1625 p2rev--verbose: -1
1625 p2rev--verbose: -1
1626 p2rev--debug: -1
1626 p2rev--debug: -1
1627 p2rev--debug: -1
1627 p2rev--debug: -1
1628 p2rev--debug: 4
1628 p2rev--debug: 4
1629 p2rev--debug: -1
1629 p2rev--debug: -1
1630 p2rev--debug: -1
1630 p2rev--debug: -1
1631 p2rev--debug: -1
1631 p2rev--debug: -1
1632 p2rev--debug: -1
1632 p2rev--debug: -1
1633 p2rev--debug: -1
1633 p2rev--debug: -1
1634 p2rev--debug: -1
1634 p2rev--debug: -1
1635 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1635 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1636 p1node: 0000000000000000000000000000000000000000
1636 p1node: 0000000000000000000000000000000000000000
1637 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
1637 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
1638 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1638 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1639 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1639 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1640 p1node: 97054abb4ab824450e9164180baf491ae0078465
1640 p1node: 97054abb4ab824450e9164180baf491ae0078465
1641 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1641 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1642 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1642 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1643 p1node: 0000000000000000000000000000000000000000
1643 p1node: 0000000000000000000000000000000000000000
1644 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1644 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1645 p1node--verbose: 0000000000000000000000000000000000000000
1645 p1node--verbose: 0000000000000000000000000000000000000000
1646 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1646 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1647 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1647 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1648 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1648 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1649 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1649 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1650 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1650 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1651 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1651 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1652 p1node--verbose: 0000000000000000000000000000000000000000
1652 p1node--verbose: 0000000000000000000000000000000000000000
1653 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1653 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1654 p1node--debug: 0000000000000000000000000000000000000000
1654 p1node--debug: 0000000000000000000000000000000000000000
1655 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1655 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1656 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1656 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1657 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1657 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1658 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
1658 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
1659 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1659 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1660 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1660 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1661 p1node--debug: 0000000000000000000000000000000000000000
1661 p1node--debug: 0000000000000000000000000000000000000000
1662 p2node: 0000000000000000000000000000000000000000
1662 p2node: 0000000000000000000000000000000000000000
1663 p2node: 0000000000000000000000000000000000000000
1663 p2node: 0000000000000000000000000000000000000000
1664 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1664 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1665 p2node: 0000000000000000000000000000000000000000
1665 p2node: 0000000000000000000000000000000000000000
1666 p2node: 0000000000000000000000000000000000000000
1666 p2node: 0000000000000000000000000000000000000000
1667 p2node: 0000000000000000000000000000000000000000
1667 p2node: 0000000000000000000000000000000000000000
1668 p2node: 0000000000000000000000000000000000000000
1668 p2node: 0000000000000000000000000000000000000000
1669 p2node: 0000000000000000000000000000000000000000
1669 p2node: 0000000000000000000000000000000000000000
1670 p2node: 0000000000000000000000000000000000000000
1670 p2node: 0000000000000000000000000000000000000000
1671 p2node--verbose: 0000000000000000000000000000000000000000
1671 p2node--verbose: 0000000000000000000000000000000000000000
1672 p2node--verbose: 0000000000000000000000000000000000000000
1672 p2node--verbose: 0000000000000000000000000000000000000000
1673 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1673 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1674 p2node--verbose: 0000000000000000000000000000000000000000
1674 p2node--verbose: 0000000000000000000000000000000000000000
1675 p2node--verbose: 0000000000000000000000000000000000000000
1675 p2node--verbose: 0000000000000000000000000000000000000000
1676 p2node--verbose: 0000000000000000000000000000000000000000
1676 p2node--verbose: 0000000000000000000000000000000000000000
1677 p2node--verbose: 0000000000000000000000000000000000000000
1677 p2node--verbose: 0000000000000000000000000000000000000000
1678 p2node--verbose: 0000000000000000000000000000000000000000
1678 p2node--verbose: 0000000000000000000000000000000000000000
1679 p2node--verbose: 0000000000000000000000000000000000000000
1679 p2node--verbose: 0000000000000000000000000000000000000000
1680 p2node--debug: 0000000000000000000000000000000000000000
1680 p2node--debug: 0000000000000000000000000000000000000000
1681 p2node--debug: 0000000000000000000000000000000000000000
1681 p2node--debug: 0000000000000000000000000000000000000000
1682 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1682 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1683 p2node--debug: 0000000000000000000000000000000000000000
1683 p2node--debug: 0000000000000000000000000000000000000000
1684 p2node--debug: 0000000000000000000000000000000000000000
1684 p2node--debug: 0000000000000000000000000000000000000000
1685 p2node--debug: 0000000000000000000000000000000000000000
1685 p2node--debug: 0000000000000000000000000000000000000000
1686 p2node--debug: 0000000000000000000000000000000000000000
1686 p2node--debug: 0000000000000000000000000000000000000000
1687 p2node--debug: 0000000000000000000000000000000000000000
1687 p2node--debug: 0000000000000000000000000000000000000000
1688 p2node--debug: 0000000000000000000000000000000000000000
1688 p2node--debug: 0000000000000000000000000000000000000000
1689
1689
1690 Filters work:
1690 Filters work:
1691
1691
1692 $ hg log --template '{author|domain}\n'
1692 $ hg log --template '{author|domain}\n'
1693
1693
1694 hostname
1694 hostname
1695
1695
1696
1696
1697
1697
1698
1698
1699 place
1699 place
1700 place
1700 place
1701 hostname
1701 hostname
1702
1702
1703 $ hg log --template '{author|person}\n'
1703 $ hg log --template '{author|person}\n'
1704 test
1704 test
1705 User Name
1705 User Name
1706 person
1706 person
1707 person
1707 person
1708 person
1708 person
1709 person
1709 person
1710 other
1710 other
1711 A. N. Other
1711 A. N. Other
1712 User Name
1712 User Name
1713
1713
1714 $ hg log --template '{author|user}\n'
1714 $ hg log --template '{author|user}\n'
1715 test
1715 test
1716 user
1716 user
1717 person
1717 person
1718 person
1718 person
1719 person
1719 person
1720 person
1720 person
1721 other
1721 other
1722 other
1722 other
1723 user
1723 user
1724
1724
1725 $ hg log --template '{date|date}\n'
1725 $ hg log --template '{date|date}\n'
1726 Wed Jan 01 10:01:00 2020 +0000
1726 Wed Jan 01 10:01:00 2020 +0000
1727 Mon Jan 12 13:46:40 1970 +0000
1727 Mon Jan 12 13:46:40 1970 +0000
1728 Sun Jan 18 08:40:01 1970 +0000
1728 Sun Jan 18 08:40:01 1970 +0000
1729 Sun Jan 18 08:40:00 1970 +0000
1729 Sun Jan 18 08:40:00 1970 +0000
1730 Sat Jan 17 04:53:20 1970 +0000
1730 Sat Jan 17 04:53:20 1970 +0000
1731 Fri Jan 16 01:06:40 1970 +0000
1731 Fri Jan 16 01:06:40 1970 +0000
1732 Wed Jan 14 21:20:00 1970 +0000
1732 Wed Jan 14 21:20:00 1970 +0000
1733 Tue Jan 13 17:33:20 1970 +0000
1733 Tue Jan 13 17:33:20 1970 +0000
1734 Mon Jan 12 13:46:40 1970 +0000
1734 Mon Jan 12 13:46:40 1970 +0000
1735
1735
1736 $ hg log --template '{date|isodate}\n'
1736 $ hg log --template '{date|isodate}\n'
1737 2020-01-01 10:01 +0000
1737 2020-01-01 10:01 +0000
1738 1970-01-12 13:46 +0000
1738 1970-01-12 13:46 +0000
1739 1970-01-18 08:40 +0000
1739 1970-01-18 08:40 +0000
1740 1970-01-18 08:40 +0000
1740 1970-01-18 08:40 +0000
1741 1970-01-17 04:53 +0000
1741 1970-01-17 04:53 +0000
1742 1970-01-16 01:06 +0000
1742 1970-01-16 01:06 +0000
1743 1970-01-14 21:20 +0000
1743 1970-01-14 21:20 +0000
1744 1970-01-13 17:33 +0000
1744 1970-01-13 17:33 +0000
1745 1970-01-12 13:46 +0000
1745 1970-01-12 13:46 +0000
1746
1746
1747 $ hg log --template '{date|isodatesec}\n'
1747 $ hg log --template '{date|isodatesec}\n'
1748 2020-01-01 10:01:00 +0000
1748 2020-01-01 10:01:00 +0000
1749 1970-01-12 13:46:40 +0000
1749 1970-01-12 13:46:40 +0000
1750 1970-01-18 08:40:01 +0000
1750 1970-01-18 08:40:01 +0000
1751 1970-01-18 08:40:00 +0000
1751 1970-01-18 08:40:00 +0000
1752 1970-01-17 04:53:20 +0000
1752 1970-01-17 04:53:20 +0000
1753 1970-01-16 01:06:40 +0000
1753 1970-01-16 01:06:40 +0000
1754 1970-01-14 21:20:00 +0000
1754 1970-01-14 21:20:00 +0000
1755 1970-01-13 17:33:20 +0000
1755 1970-01-13 17:33:20 +0000
1756 1970-01-12 13:46:40 +0000
1756 1970-01-12 13:46:40 +0000
1757
1757
1758 $ hg log --template '{date|rfc822date}\n'
1758 $ hg log --template '{date|rfc822date}\n'
1759 Wed, 01 Jan 2020 10:01:00 +0000
1759 Wed, 01 Jan 2020 10:01:00 +0000
1760 Mon, 12 Jan 1970 13:46:40 +0000
1760 Mon, 12 Jan 1970 13:46:40 +0000
1761 Sun, 18 Jan 1970 08:40:01 +0000
1761 Sun, 18 Jan 1970 08:40:01 +0000
1762 Sun, 18 Jan 1970 08:40:00 +0000
1762 Sun, 18 Jan 1970 08:40:00 +0000
1763 Sat, 17 Jan 1970 04:53:20 +0000
1763 Sat, 17 Jan 1970 04:53:20 +0000
1764 Fri, 16 Jan 1970 01:06:40 +0000
1764 Fri, 16 Jan 1970 01:06:40 +0000
1765 Wed, 14 Jan 1970 21:20:00 +0000
1765 Wed, 14 Jan 1970 21:20:00 +0000
1766 Tue, 13 Jan 1970 17:33:20 +0000
1766 Tue, 13 Jan 1970 17:33:20 +0000
1767 Mon, 12 Jan 1970 13:46:40 +0000
1767 Mon, 12 Jan 1970 13:46:40 +0000
1768
1768
1769 $ hg log --template '{desc|firstline}\n'
1769 $ hg log --template '{desc|firstline}\n'
1770 third
1770 third
1771 second
1771 second
1772 merge
1772 merge
1773 new head
1773 new head
1774 new branch
1774 new branch
1775 no user, no domain
1775 no user, no domain
1776 no person
1776 no person
1777 other 1
1777 other 1
1778 line 1
1778 line 1
1779
1779
1780 $ hg log --template '{node|short}\n'
1780 $ hg log --template '{node|short}\n'
1781 95c24699272e
1781 95c24699272e
1782 29114dbae42b
1782 29114dbae42b
1783 d41e714fe50d
1783 d41e714fe50d
1784 13207e5a10d9
1784 13207e5a10d9
1785 bbe44766e73d
1785 bbe44766e73d
1786 10e46f2dcbf4
1786 10e46f2dcbf4
1787 97054abb4ab8
1787 97054abb4ab8
1788 b608e9d1a3f0
1788 b608e9d1a3f0
1789 1e4e1b8f71e0
1789 1e4e1b8f71e0
1790
1790
1791 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1791 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1792 <changeset author="test"/>
1792 <changeset author="test"/>
1793 <changeset author="User Name &lt;user@hostname&gt;"/>
1793 <changeset author="User Name &lt;user@hostname&gt;"/>
1794 <changeset author="person"/>
1794 <changeset author="person"/>
1795 <changeset author="person"/>
1795 <changeset author="person"/>
1796 <changeset author="person"/>
1796 <changeset author="person"/>
1797 <changeset author="person"/>
1797 <changeset author="person"/>
1798 <changeset author="other@place"/>
1798 <changeset author="other@place"/>
1799 <changeset author="A. N. Other &lt;other@place&gt;"/>
1799 <changeset author="A. N. Other &lt;other@place&gt;"/>
1800 <changeset author="User Name &lt;user@hostname&gt;"/>
1800 <changeset author="User Name &lt;user@hostname&gt;"/>
1801
1801
1802 $ hg log --template '{rev}: {children}\n'
1802 $ hg log --template '{rev}: {children}\n'
1803 8:
1803 8:
1804 7: 8:95c24699272e
1804 7: 8:95c24699272e
1805 6:
1805 6:
1806 5: 6:d41e714fe50d
1806 5: 6:d41e714fe50d
1807 4: 6:d41e714fe50d
1807 4: 6:d41e714fe50d
1808 3: 4:bbe44766e73d 5:13207e5a10d9
1808 3: 4:bbe44766e73d 5:13207e5a10d9
1809 2: 3:10e46f2dcbf4
1809 2: 3:10e46f2dcbf4
1810 1: 2:97054abb4ab8
1810 1: 2:97054abb4ab8
1811 0: 1:b608e9d1a3f0
1811 0: 1:b608e9d1a3f0
1812
1812
1813 Formatnode filter works:
1813 Formatnode filter works:
1814
1814
1815 $ hg -q log -r 0 --template '{node|formatnode}\n'
1815 $ hg -q log -r 0 --template '{node|formatnode}\n'
1816 1e4e1b8f71e0
1816 1e4e1b8f71e0
1817
1817
1818 $ hg log -r 0 --template '{node|formatnode}\n'
1818 $ hg log -r 0 --template '{node|formatnode}\n'
1819 1e4e1b8f71e0
1819 1e4e1b8f71e0
1820
1820
1821 $ hg -v log -r 0 --template '{node|formatnode}\n'
1821 $ hg -v log -r 0 --template '{node|formatnode}\n'
1822 1e4e1b8f71e0
1822 1e4e1b8f71e0
1823
1823
1824 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1824 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1825 1e4e1b8f71e05681d422154f5421e385fec3454f
1825 1e4e1b8f71e05681d422154f5421e385fec3454f
1826
1826
1827 Age filter:
1827 Age filter:
1828
1828
1829 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1829 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1830
1830
1831 >>> from datetime import datetime, timedelta
1831 >>> from datetime import datetime, timedelta
1832 >>> fp = open('a', 'w')
1832 >>> fp = open('a', 'w')
1833 >>> n = datetime.now() + timedelta(366 * 7)
1833 >>> n = datetime.now() + timedelta(366 * 7)
1834 >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
1834 >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
1835 >>> fp.close()
1835 >>> fp.close()
1836 $ hg add a
1836 $ hg add a
1837 $ hg commit -m future -d "`cat a`"
1837 $ hg commit -m future -d "`cat a`"
1838
1838
1839 $ hg log -l1 --template '{date|age}\n'
1839 $ hg log -l1 --template '{date|age}\n'
1840 7 years from now
1840 7 years from now
1841
1841
1842 Count filter:
1842 Count filter:
1843
1843
1844 $ hg log -l1 --template '{node|count} {node|short|count}\n'
1844 $ hg log -l1 --template '{node|count} {node|short|count}\n'
1845 40 12
1845 40 12
1846
1846
1847 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
1847 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
1848 0 1 4
1848 0 1 4
1849
1849
1850 $ hg log -G --template '{rev}: children: {children|count}, \
1850 $ hg log -G --template '{rev}: children: {children|count}, \
1851 > tags: {tags|count}, file_adds: {file_adds|count}, \
1851 > tags: {tags|count}, file_adds: {file_adds|count}, \
1852 > ancestors: {revset("ancestors(%s)", rev)|count}'
1852 > ancestors: {revset("ancestors(%s)", rev)|count}'
1853 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
1853 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
1854 |
1854 |
1855 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
1855 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
1856 |
1856 |
1857 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
1857 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
1858
1858
1859 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
1859 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
1860 |\
1860 |\
1861 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
1861 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
1862 | |
1862 | |
1863 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
1863 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
1864 |/
1864 |/
1865 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
1865 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
1866 |
1866 |
1867 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
1867 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
1868 |
1868 |
1869 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
1869 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
1870 |
1870 |
1871 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
1871 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
1872
1872
1873
1873
1874 Upper/lower filters:
1875
1876 $ hg log -r0 --template '{branch|upper}\n'
1877 DEFAULT
1878 $ hg log -r0 --template '{author|lower}\n'
1879 user name <user@hostname>
1880 $ hg log -r0 --template '{date|upper}\n'
1881 abort: template filter 'upper' is not compatible with keyword 'date'
1882 [255]
1883
1874 Error on syntax:
1884 Error on syntax:
1875
1885
1876 $ echo 'x = "f' >> t
1886 $ echo 'x = "f' >> t
1877 $ hg log
1887 $ hg log
1878 abort: t:3: unmatched quotes
1888 abort: t:3: unmatched quotes
1879 [255]
1889 [255]
1880
1890
1881 Behind the scenes, this will throw TypeError
1891 Behind the scenes, this will throw TypeError
1882
1892
1883 $ hg log -l 3 --template '{date|obfuscate}\n'
1893 $ hg log -l 3 --template '{date|obfuscate}\n'
1884 abort: template filter 'obfuscate' is not compatible with keyword 'date'
1894 abort: template filter 'obfuscate' is not compatible with keyword 'date'
1885 [255]
1895 [255]
1886
1896
1887 Behind the scenes, this will throw a ValueError
1897 Behind the scenes, this will throw a ValueError
1888
1898
1889 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
1899 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
1890 abort: template filter 'shortdate' is not compatible with keyword 'desc'
1900 abort: template filter 'shortdate' is not compatible with keyword 'desc'
1891 [255]
1901 [255]
1892
1902
1893 Behind the scenes, this will throw AttributeError
1903 Behind the scenes, this will throw AttributeError
1894
1904
1895 $ hg log -l 3 --template 'line: {date|escape}\n'
1905 $ hg log -l 3 --template 'line: {date|escape}\n'
1896 abort: template filter 'escape' is not compatible with keyword 'date'
1906 abort: template filter 'escape' is not compatible with keyword 'date'
1897 [255]
1907 [255]
1898
1908
1899 Behind the scenes, this will throw ValueError
1909 Behind the scenes, this will throw ValueError
1900
1910
1901 $ hg tip --template '{author|email|date}\n'
1911 $ hg tip --template '{author|email|date}\n'
1902 abort: template filter 'datefilter' is not compatible with keyword 'author'
1912 abort: template filter 'datefilter' is not compatible with keyword 'author'
1903 [255]
1913 [255]
1904
1914
1905 Thrown an error if a template function doesn't exist
1915 Thrown an error if a template function doesn't exist
1906
1916
1907 $ hg tip --template '{foo()}\n'
1917 $ hg tip --template '{foo()}\n'
1908 hg: parse error: unknown function 'foo'
1918 hg: parse error: unknown function 'foo'
1909 [255]
1919 [255]
1910
1920
1911 Pass generator object created by template function to filter
1921 Pass generator object created by template function to filter
1912
1922
1913 $ hg log -l 1 --template '{if(author, author)|user}\n'
1923 $ hg log -l 1 --template '{if(author, author)|user}\n'
1914 test
1924 test
1915
1925
1916 Test diff function:
1926 Test diff function:
1917
1927
1918 $ hg diff -c 8
1928 $ hg diff -c 8
1919 diff -r 29114dbae42b -r 95c24699272e fourth
1929 diff -r 29114dbae42b -r 95c24699272e fourth
1920 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1921 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
1931 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
1922 @@ -0,0 +1,1 @@
1932 @@ -0,0 +1,1 @@
1923 +second
1933 +second
1924 diff -r 29114dbae42b -r 95c24699272e second
1934 diff -r 29114dbae42b -r 95c24699272e second
1925 --- a/second Mon Jan 12 13:46:40 1970 +0000
1935 --- a/second Mon Jan 12 13:46:40 1970 +0000
1926 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1936 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1927 @@ -1,1 +0,0 @@
1937 @@ -1,1 +0,0 @@
1928 -second
1938 -second
1929 diff -r 29114dbae42b -r 95c24699272e third
1939 diff -r 29114dbae42b -r 95c24699272e third
1930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1940 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1931 +++ b/third Wed Jan 01 10:01:00 2020 +0000
1941 +++ b/third Wed Jan 01 10:01:00 2020 +0000
1932 @@ -0,0 +1,1 @@
1942 @@ -0,0 +1,1 @@
1933 +third
1943 +third
1934
1944
1935 $ hg log -r 8 -T "{diff()}"
1945 $ hg log -r 8 -T "{diff()}"
1936 diff -r 29114dbae42b -r 95c24699272e fourth
1946 diff -r 29114dbae42b -r 95c24699272e fourth
1937 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1947 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1938 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
1948 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
1939 @@ -0,0 +1,1 @@
1949 @@ -0,0 +1,1 @@
1940 +second
1950 +second
1941 diff -r 29114dbae42b -r 95c24699272e second
1951 diff -r 29114dbae42b -r 95c24699272e second
1942 --- a/second Mon Jan 12 13:46:40 1970 +0000
1952 --- a/second Mon Jan 12 13:46:40 1970 +0000
1943 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1953 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1944 @@ -1,1 +0,0 @@
1954 @@ -1,1 +0,0 @@
1945 -second
1955 -second
1946 diff -r 29114dbae42b -r 95c24699272e third
1956 diff -r 29114dbae42b -r 95c24699272e third
1947 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1957 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1948 +++ b/third Wed Jan 01 10:01:00 2020 +0000
1958 +++ b/third Wed Jan 01 10:01:00 2020 +0000
1949 @@ -0,0 +1,1 @@
1959 @@ -0,0 +1,1 @@
1950 +third
1960 +third
1951
1961
1952 $ hg log -r 8 -T "{diff('glob:f*')}"
1962 $ hg log -r 8 -T "{diff('glob:f*')}"
1953 diff -r 29114dbae42b -r 95c24699272e fourth
1963 diff -r 29114dbae42b -r 95c24699272e fourth
1954 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1964 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1955 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
1965 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
1956 @@ -0,0 +1,1 @@
1966 @@ -0,0 +1,1 @@
1957 +second
1967 +second
1958
1968
1959 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
1969 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
1960 diff -r 29114dbae42b -r 95c24699272e second
1970 diff -r 29114dbae42b -r 95c24699272e second
1961 --- a/second Mon Jan 12 13:46:40 1970 +0000
1971 --- a/second Mon Jan 12 13:46:40 1970 +0000
1962 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1972 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1963 @@ -1,1 +0,0 @@
1973 @@ -1,1 +0,0 @@
1964 -second
1974 -second
1965 diff -r 29114dbae42b -r 95c24699272e third
1975 diff -r 29114dbae42b -r 95c24699272e third
1966 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1976 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1967 +++ b/third Wed Jan 01 10:01:00 2020 +0000
1977 +++ b/third Wed Jan 01 10:01:00 2020 +0000
1968 @@ -0,0 +1,1 @@
1978 @@ -0,0 +1,1 @@
1969 +third
1979 +third
1970
1980
1971 $ cd ..
1981 $ cd ..
1972
1982
1973
1983
1974 latesttag:
1984 latesttag:
1975
1985
1976 $ hg init latesttag
1986 $ hg init latesttag
1977 $ cd latesttag
1987 $ cd latesttag
1978
1988
1979 $ echo a > file
1989 $ echo a > file
1980 $ hg ci -Am a -d '0 0'
1990 $ hg ci -Am a -d '0 0'
1981 adding file
1991 adding file
1982
1992
1983 $ echo b >> file
1993 $ echo b >> file
1984 $ hg ci -m b -d '1 0'
1994 $ hg ci -m b -d '1 0'
1985
1995
1986 $ echo c >> head1
1996 $ echo c >> head1
1987 $ hg ci -Am h1c -d '2 0'
1997 $ hg ci -Am h1c -d '2 0'
1988 adding head1
1998 adding head1
1989
1999
1990 $ hg update -q 1
2000 $ hg update -q 1
1991 $ echo d >> head2
2001 $ echo d >> head2
1992 $ hg ci -Am h2d -d '3 0'
2002 $ hg ci -Am h2d -d '3 0'
1993 adding head2
2003 adding head2
1994 created new head
2004 created new head
1995
2005
1996 $ echo e >> head2
2006 $ echo e >> head2
1997 $ hg ci -m h2e -d '4 0'
2007 $ hg ci -m h2e -d '4 0'
1998
2008
1999 $ hg merge -q
2009 $ hg merge -q
2000 $ hg ci -m merge -d '5 -3600'
2010 $ hg ci -m merge -d '5 -3600'
2001
2011
2002 No tag set:
2012 No tag set:
2003
2013
2004 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2014 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2005 5: null+5
2015 5: null+5
2006 4: null+4
2016 4: null+4
2007 3: null+3
2017 3: null+3
2008 2: null+3
2018 2: null+3
2009 1: null+2
2019 1: null+2
2010 0: null+1
2020 0: null+1
2011
2021
2012 One common tag: longest path wins:
2022 One common tag: longest path wins:
2013
2023
2014 $ hg tag -r 1 -m t1 -d '6 0' t1
2024 $ hg tag -r 1 -m t1 -d '6 0' t1
2015 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2025 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2016 6: t1+4
2026 6: t1+4
2017 5: t1+3
2027 5: t1+3
2018 4: t1+2
2028 4: t1+2
2019 3: t1+1
2029 3: t1+1
2020 2: t1+1
2030 2: t1+1
2021 1: t1+0
2031 1: t1+0
2022 0: null+1
2032 0: null+1
2023
2033
2024 One ancestor tag: more recent wins:
2034 One ancestor tag: more recent wins:
2025
2035
2026 $ hg tag -r 2 -m t2 -d '7 0' t2
2036 $ hg tag -r 2 -m t2 -d '7 0' t2
2027 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2037 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2028 7: t2+3
2038 7: t2+3
2029 6: t2+2
2039 6: t2+2
2030 5: t2+1
2040 5: t2+1
2031 4: t1+2
2041 4: t1+2
2032 3: t1+1
2042 3: t1+1
2033 2: t2+0
2043 2: t2+0
2034 1: t1+0
2044 1: t1+0
2035 0: null+1
2045 0: null+1
2036
2046
2037 Two branch tags: more recent wins:
2047 Two branch tags: more recent wins:
2038
2048
2039 $ hg tag -r 3 -m t3 -d '8 0' t3
2049 $ hg tag -r 3 -m t3 -d '8 0' t3
2040 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2050 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2041 8: t3+5
2051 8: t3+5
2042 7: t3+4
2052 7: t3+4
2043 6: t3+3
2053 6: t3+3
2044 5: t3+2
2054 5: t3+2
2045 4: t3+1
2055 4: t3+1
2046 3: t3+0
2056 3: t3+0
2047 2: t2+0
2057 2: t2+0
2048 1: t1+0
2058 1: t1+0
2049 0: null+1
2059 0: null+1
2050
2060
2051 Merged tag overrides:
2061 Merged tag overrides:
2052
2062
2053 $ hg tag -r 5 -m t5 -d '9 0' t5
2063 $ hg tag -r 5 -m t5 -d '9 0' t5
2054 $ hg tag -r 3 -m at3 -d '10 0' at3
2064 $ hg tag -r 3 -m at3 -d '10 0' at3
2055 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2065 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
2056 10: t5+5
2066 10: t5+5
2057 9: t5+4
2067 9: t5+4
2058 8: t5+3
2068 8: t5+3
2059 7: t5+2
2069 7: t5+2
2060 6: t5+1
2070 6: t5+1
2061 5: t5+0
2071 5: t5+0
2062 4: at3:t3+1
2072 4: at3:t3+1
2063 3: at3:t3+0
2073 3: at3:t3+0
2064 2: t2+0
2074 2: t2+0
2065 1: t1+0
2075 1: t1+0
2066 0: null+1
2076 0: null+1
2067
2077
2068 $ cd ..
2078 $ cd ..
2069
2079
2070
2080
2071 Style path expansion: issue1948 - ui.style option doesn't work on OSX
2081 Style path expansion: issue1948 - ui.style option doesn't work on OSX
2072 if it is a relative path
2082 if it is a relative path
2073
2083
2074 $ mkdir -p home/styles
2084 $ mkdir -p home/styles
2075
2085
2076 $ cat > home/styles/teststyle <<EOF
2086 $ cat > home/styles/teststyle <<EOF
2077 > changeset = 'test {rev}:{node|short}\n'
2087 > changeset = 'test {rev}:{node|short}\n'
2078 > EOF
2088 > EOF
2079
2089
2080 $ HOME=`pwd`/home; export HOME
2090 $ HOME=`pwd`/home; export HOME
2081
2091
2082 $ cat > latesttag/.hg/hgrc <<EOF
2092 $ cat > latesttag/.hg/hgrc <<EOF
2083 > [ui]
2093 > [ui]
2084 > style = ~/styles/teststyle
2094 > style = ~/styles/teststyle
2085 > EOF
2095 > EOF
2086
2096
2087 $ hg -R latesttag tip
2097 $ hg -R latesttag tip
2088 test 10:9b4a630e5f5f
2098 test 10:9b4a630e5f5f
2089
2099
2090 Test recursive showlist template (issue1989):
2100 Test recursive showlist template (issue1989):
2091
2101
2092 $ cat > style1989 <<EOF
2102 $ cat > style1989 <<EOF
2093 > changeset = '{file_mods}{manifest}{extras}'
2103 > changeset = '{file_mods}{manifest}{extras}'
2094 > file_mod = 'M|{author|person}\n'
2104 > file_mod = 'M|{author|person}\n'
2095 > manifest = '{rev},{author}\n'
2105 > manifest = '{rev},{author}\n'
2096 > extra = '{key}: {author}\n'
2106 > extra = '{key}: {author}\n'
2097 > EOF
2107 > EOF
2098
2108
2099 $ hg -R latesttag log -r tip --style=style1989
2109 $ hg -R latesttag log -r tip --style=style1989
2100 M|test
2110 M|test
2101 10,test
2111 10,test
2102 branch: test
2112 branch: test
2103
2113
2104 Test new-style inline templating:
2114 Test new-style inline templating:
2105
2115
2106 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
2116 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
2107 modified files: .hgtags
2117 modified files: .hgtags
2108
2118
2109 Test the sub function of templating for expansion:
2119 Test the sub function of templating for expansion:
2110
2120
2111 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
2121 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
2112 xx
2122 xx
2113
2123
2114 Test the strip function with chars specified:
2124 Test the strip function with chars specified:
2115
2125
2116 $ hg log -R latesttag --template '{desc}\n'
2126 $ hg log -R latesttag --template '{desc}\n'
2117 at3
2127 at3
2118 t5
2128 t5
2119 t3
2129 t3
2120 t2
2130 t2
2121 t1
2131 t1
2122 merge
2132 merge
2123 h2e
2133 h2e
2124 h2d
2134 h2d
2125 h1c
2135 h1c
2126 b
2136 b
2127 a
2137 a
2128
2138
2129 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
2139 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
2130 at3
2140 at3
2131 5
2141 5
2132 3
2142 3
2133 2
2143 2
2134 1
2144 1
2135 merg
2145 merg
2136 h2
2146 h2
2137 h2d
2147 h2d
2138 h1c
2148 h1c
2139 b
2149 b
2140 a
2150 a
2141
2151
2142 Test date format:
2152 Test date format:
2143
2153
2144 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
2154 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
2145 date: 70 01 01 10 +0000
2155 date: 70 01 01 10 +0000
2146 date: 70 01 01 09 +0000
2156 date: 70 01 01 09 +0000
2147 date: 70 01 01 08 +0000
2157 date: 70 01 01 08 +0000
2148 date: 70 01 01 07 +0000
2158 date: 70 01 01 07 +0000
2149 date: 70 01 01 06 +0000
2159 date: 70 01 01 06 +0000
2150 date: 70 01 01 05 +0100
2160 date: 70 01 01 05 +0100
2151 date: 70 01 01 04 +0000
2161 date: 70 01 01 04 +0000
2152 date: 70 01 01 03 +0000
2162 date: 70 01 01 03 +0000
2153 date: 70 01 01 02 +0000
2163 date: 70 01 01 02 +0000
2154 date: 70 01 01 01 +0000
2164 date: 70 01 01 01 +0000
2155 date: 70 01 01 00 +0000
2165 date: 70 01 01 00 +0000
2156
2166
2157 Test string escaping:
2167 Test string escaping:
2158
2168
2159 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2169 $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
2160 >
2170 >
2161 <>\n<[>
2171 <>\n<[>
2162 <>\n<]>
2172 <>\n<]>
2163 <>\n<
2173 <>\n<
2164
2174
2165 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
2175 "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice)
2166
2176
2167 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
2177 $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n'
2168 \x6e
2178 \x6e
2169 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
2179 $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n'
2170 \x5c\x786e
2180 \x5c\x786e
2171 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
2181 $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n'
2172 \x6e
2182 \x6e
2173 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
2183 $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n'
2174 \x5c\x786e
2184 \x5c\x786e
2175
2185
2176 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
2186 $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n'
2177 \x6e
2187 \x6e
2178 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
2188 $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n'
2179 \x5c\x786e
2189 \x5c\x786e
2180 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
2190 $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n'
2181 \x6e
2191 \x6e
2182 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
2192 $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n'
2183 \x5c\x786e
2193 \x5c\x786e
2184
2194
2185 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
2195 $ hg log -R a -r 8 --template '{join(files, "\n")}\n'
2186 fourth
2196 fourth
2187 second
2197 second
2188 third
2198 third
2189 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
2199 $ hg log -R a -r 8 --template '{join(files, r"\n")}\n'
2190 fourth\nsecond\nthird
2200 fourth\nsecond\nthird
2191
2201
2192 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
2202 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'
2193 <p>
2203 <p>
2194 1st
2204 1st
2195 </p>
2205 </p>
2196 <p>
2206 <p>
2197 2nd
2207 2nd
2198 </p>
2208 </p>
2199 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
2209 $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'
2200 <p>
2210 <p>
2201 1st\n\n2nd
2211 1st\n\n2nd
2202 </p>
2212 </p>
2203 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
2213 $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}'
2204 1st
2214 1st
2205
2215
2206 2nd
2216 2nd
2207
2217
2208 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
2218 $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n'
2209 o perso
2219 o perso
2210 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
2220 $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n'
2211 no person
2221 no person
2212 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
2222 $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n'
2213 o perso
2223 o perso
2214 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
2224 $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n'
2215 no perso
2225 no perso
2216
2226
2217 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
2227 $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n'
2218 -o perso-
2228 -o perso-
2219 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
2229 $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n'
2220 no person
2230 no person
2221 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
2231 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n'
2222 \x2do perso\x2d
2232 \x2do perso\x2d
2223 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
2233 $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n'
2224 -o perso-
2234 -o perso-
2225 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
2235 $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n'
2226 \x2do perso\x6e
2236 \x2do perso\x6e
2227
2237
2228 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
2238 $ hg log -R a -r 8 --template '{files % "{file}\n"}'
2229 fourth
2239 fourth
2230 second
2240 second
2231 third
2241 third
2232 $ hg log -R a -r 8 --template '{files % r"{file}\n"}\n'
2242 $ hg log -R a -r 8 --template '{files % r"{file}\n"}\n'
2233 fourth\nsecond\nthird\n
2243 fourth\nsecond\nthird\n
2234
2244
2235 Test string escaping in nested expression:
2245 Test string escaping in nested expression:
2236
2246
2237 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
2247 $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n'
2238 fourth\x6esecond\x6ethird
2248 fourth\x6esecond\x6ethird
2239 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
2249 $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n'
2240 fourth\x6esecond\x6ethird
2250 fourth\x6esecond\x6ethird
2241
2251
2242 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
2252 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n'
2243 fourth\x6esecond\x6ethird
2253 fourth\x6esecond\x6ethird
2244 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
2254 $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n'
2245 fourth\x5c\x786esecond\x5c\x786ethird
2255 fourth\x5c\x786esecond\x5c\x786ethird
2246
2256
2247 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
2257 $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n'
2248 3:\x6eo user, \x6eo domai\x6e
2258 3:\x6eo user, \x6eo domai\x6e
2249 4:\x5c\x786eew bra\x5c\x786ech
2259 4:\x5c\x786eew bra\x5c\x786ech
2250
2260
2251 Test recursive evaluation:
2261 Test recursive evaluation:
2252
2262
2253 $ hg init r
2263 $ hg init r
2254 $ cd r
2264 $ cd r
2255 $ echo a > a
2265 $ echo a > a
2256 $ hg ci -Am '{rev}'
2266 $ hg ci -Am '{rev}'
2257 adding a
2267 adding a
2258 $ hg log -r 0 --template '{if(rev, desc)}\n'
2268 $ hg log -r 0 --template '{if(rev, desc)}\n'
2259 {rev}
2269 {rev}
2260 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
2270 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
2261 test 0
2271 test 0
2262
2272
2263 $ hg branch -q 'text.{rev}'
2273 $ hg branch -q 'text.{rev}'
2264 $ echo aa >> aa
2274 $ echo aa >> aa
2265 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
2275 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
2266
2276
2267 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
2277 $ hg log -l1 --template '{fill(desc, "20", author, branch)}'
2268 {node|short}desc to
2278 {node|short}desc to
2269 text.{rev}be wrapped
2279 text.{rev}be wrapped
2270 text.{rev}desc to be
2280 text.{rev}desc to be
2271 text.{rev}wrapped (no-eol)
2281 text.{rev}wrapped (no-eol)
2272 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
2282 $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}'
2273 bcc7ff960b8e:desc to
2283 bcc7ff960b8e:desc to
2274 text.1:be wrapped
2284 text.1:be wrapped
2275 text.1:desc to be
2285 text.1:desc to be
2276 text.1:wrapped (no-eol)
2286 text.1:wrapped (no-eol)
2277
2287
2278 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
2288 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
2279 {node|short} (no-eol)
2289 {node|short} (no-eol)
2280 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
2290 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
2281 bcc-ff---b-e (no-eol)
2291 bcc-ff---b-e (no-eol)
2282
2292
2283 $ cat >> .hg/hgrc <<EOF
2293 $ cat >> .hg/hgrc <<EOF
2284 > [extensions]
2294 > [extensions]
2285 > color=
2295 > color=
2286 > [color]
2296 > [color]
2287 > mode=ansi
2297 > mode=ansi
2288 > text.{rev} = red
2298 > text.{rev} = red
2289 > text.1 = green
2299 > text.1 = green
2290 > EOF
2300 > EOF
2291 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
2301 $ hg log --color=always -l 1 --template '{label(branch, "text\n")}'
2292 \x1b[0;31mtext\x1b[0m (esc)
2302 \x1b[0;31mtext\x1b[0m (esc)
2293 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
2303 $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}'
2294 \x1b[0;32mtext\x1b[0m (esc)
2304 \x1b[0;32mtext\x1b[0m (esc)
2295
2305
2296 Test branches inside if statement:
2306 Test branches inside if statement:
2297
2307
2298 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
2308 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
2299 no
2309 no
2300
2310
2301 Test get function:
2311 Test get function:
2302
2312
2303 $ hg log -r 0 --template '{get(extras, "branch")}\n'
2313 $ hg log -r 0 --template '{get(extras, "branch")}\n'
2304 default
2314 default
2305 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
2315 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
2306 hg: parse error: get() expects a dict as first argument
2316 hg: parse error: get() expects a dict as first argument
2307 [255]
2317 [255]
2308
2318
2309 Test shortest(node) function:
2319 Test shortest(node) function:
2310
2320
2311 $ echo b > b
2321 $ echo b > b
2312 $ hg ci -qAm b
2322 $ hg ci -qAm b
2313 $ hg log --template '{shortest(node)}\n'
2323 $ hg log --template '{shortest(node)}\n'
2314 e777
2324 e777
2315 bcc7
2325 bcc7
2316 f776
2326 f776
2317 $ hg log --template '{shortest(node, 10)}\n'
2327 $ hg log --template '{shortest(node, 10)}\n'
2318 e777603221
2328 e777603221
2319 bcc7ff960b
2329 bcc7ff960b
2320 f7769ec2ab
2330 f7769ec2ab
2321
2331
2322 Test pad function
2332 Test pad function
2323
2333
2324 $ hg log --template '{pad(rev, 20)} {author|user}\n'
2334 $ hg log --template '{pad(rev, 20)} {author|user}\n'
2325 2 test
2335 2 test
2326 1 {node|short}
2336 1 {node|short}
2327 0 test
2337 0 test
2328
2338
2329 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
2339 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
2330 2 test
2340 2 test
2331 1 {node|short}
2341 1 {node|short}
2332 0 test
2342 0 test
2333
2343
2334 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
2344 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
2335 2------------------- test
2345 2------------------- test
2336 1------------------- {node|short}
2346 1------------------- {node|short}
2337 0------------------- test
2347 0------------------- test
2338
2348
2339 Test ifcontains function
2349 Test ifcontains function
2340
2350
2341 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
2351 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
2342 2 is in the string
2352 2 is in the string
2343 1 is not
2353 1 is not
2344 0 is in the string
2354 0 is in the string
2345
2355
2346 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
2356 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
2347 2 did not add a
2357 2 did not add a
2348 1 did not add a
2358 1 did not add a
2349 0 added a
2359 0 added a
2350
2360
2351 Test revset function
2361 Test revset function
2352
2362
2353 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
2363 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
2354 2 current rev
2364 2 current rev
2355 1 not current rev
2365 1 not current rev
2356 0 not current rev
2366 0 not current rev
2357
2367
2358 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
2368 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
2359 2 match rev
2369 2 match rev
2360 1 match rev
2370 1 match rev
2361 0 not match rev
2371 0 not match rev
2362
2372
2363 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
2373 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
2364 2 Parents: 1
2374 2 Parents: 1
2365 1 Parents: 0
2375 1 Parents: 0
2366 0 Parents:
2376 0 Parents:
2367
2377
2368 $ cat >> .hg/hgrc <<EOF
2378 $ cat >> .hg/hgrc <<EOF
2369 > [revsetalias]
2379 > [revsetalias]
2370 > myparents(\$1) = parents(\$1)
2380 > myparents(\$1) = parents(\$1)
2371 > EOF
2381 > EOF
2372 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
2382 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
2373 2 Parents: 1
2383 2 Parents: 1
2374 1 Parents: 0
2384 1 Parents: 0
2375 0 Parents:
2385 0 Parents:
2376
2386
2377 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
2387 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
2378 Rev: 2
2388 Rev: 2
2379 Ancestor: 0
2389 Ancestor: 0
2380 Ancestor: 1
2390 Ancestor: 1
2381 Ancestor: 2
2391 Ancestor: 2
2382
2392
2383 Rev: 1
2393 Rev: 1
2384 Ancestor: 0
2394 Ancestor: 0
2385 Ancestor: 1
2395 Ancestor: 1
2386
2396
2387 Rev: 0
2397 Rev: 0
2388 Ancestor: 0
2398 Ancestor: 0
2389
2399
2390 Test current bookmark templating
2400 Test current bookmark templating
2391
2401
2392 $ hg book foo
2402 $ hg book foo
2393 $ hg book bar
2403 $ hg book bar
2394 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, current, \"*\")} '}\n"
2404 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, current, \"*\")} '}\n"
2395 2 bar* foo
2405 2 bar* foo
2396 1
2406 1
2397 0
2407 0
2398 $ hg log --template "{rev} {currentbookmark}\n"
2408 $ hg log --template "{rev} {currentbookmark}\n"
2399 2 bar
2409 2 bar
2400 1
2410 1
2401 0
2411 0
2402 $ hg bookmarks --inactive bar
2412 $ hg bookmarks --inactive bar
2403 $ hg log --template "{rev} {currentbookmark}\n"
2413 $ hg log --template "{rev} {currentbookmark}\n"
2404 2
2414 2
2405 1
2415 1
2406 0
2416 0
2407 $ hg book -r1 baz
2417 $ hg book -r1 baz
2408 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
2418 $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
2409 2 bar foo
2419 2 bar foo
2410 1 baz
2420 1 baz
2411 0
2421 0
2412 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
2422 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
2413 2 t
2423 2 t
2414 1 f
2424 1 f
2415 0 f
2425 0 f
2416
2426
2417 Test stringify on sub expressions
2427 Test stringify on sub expressions
2418
2428
2419 $ cd ..
2429 $ cd ..
2420 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
2430 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
2421 fourth, second, third
2431 fourth, second, third
2422 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
2432 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
2423 abc
2433 abc
2424
2434
2425 Test splitlines
2435 Test splitlines
2426
2436
2427 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
2437 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
2428 @ foo future
2438 @ foo future
2429 |
2439 |
2430 o foo third
2440 o foo third
2431 |
2441 |
2432 o foo second
2442 o foo second
2433
2443
2434 o foo merge
2444 o foo merge
2435 |\
2445 |\
2436 | o foo new head
2446 | o foo new head
2437 | |
2447 | |
2438 o | foo new branch
2448 o | foo new branch
2439 |/
2449 |/
2440 o foo no user, no domain
2450 o foo no user, no domain
2441 |
2451 |
2442 o foo no person
2452 o foo no person
2443 |
2453 |
2444 o foo other 1
2454 o foo other 1
2445 | foo other 2
2455 | foo other 2
2446 | foo
2456 | foo
2447 | foo other 3
2457 | foo other 3
2448 o foo line 1
2458 o foo line 1
2449 foo line 2
2459 foo line 2
2450
2460
2451 Test startswith
2461 Test startswith
2452 $ hg log -Gv -R a --template "{startswith(desc)}"
2462 $ hg log -Gv -R a --template "{startswith(desc)}"
2453 hg: parse error: startswith expects two arguments
2463 hg: parse error: startswith expects two arguments
2454 [255]
2464 [255]
2455
2465
2456 $ hg log -Gv -R a --template "{startswith('line', desc)}"
2466 $ hg log -Gv -R a --template "{startswith('line', desc)}"
2457 @
2467 @
2458 |
2468 |
2459 o
2469 o
2460 |
2470 |
2461 o
2471 o
2462
2472
2463 o
2473 o
2464 |\
2474 |\
2465 | o
2475 | o
2466 | |
2476 | |
2467 o |
2477 o |
2468 |/
2478 |/
2469 o
2479 o
2470 |
2480 |
2471 o
2481 o
2472 |
2482 |
2473 o
2483 o
2474 |
2484 |
2475 o line 1
2485 o line 1
2476 line 2
2486 line 2
2477
2487
2478 Test bad template with better error message
2488 Test bad template with better error message
2479
2489
2480 $ hg log -Gv -R a --template '{desc|user()}'
2490 $ hg log -Gv -R a --template '{desc|user()}'
2481 hg: parse error: expected a symbol, got 'func'
2491 hg: parse error: expected a symbol, got 'func'
2482 [255]
2492 [255]
2483
2493
2484 Test word function (including index out of bounds graceful failure)
2494 Test word function (including index out of bounds graceful failure)
2485
2495
2486 $ hg log -Gv -R a --template "{word('1', desc)}"
2496 $ hg log -Gv -R a --template "{word('1', desc)}"
2487 @
2497 @
2488 |
2498 |
2489 o
2499 o
2490 |
2500 |
2491 o
2501 o
2492
2502
2493 o
2503 o
2494 |\
2504 |\
2495 | o head
2505 | o head
2496 | |
2506 | |
2497 o | branch
2507 o | branch
2498 |/
2508 |/
2499 o user,
2509 o user,
2500 |
2510 |
2501 o person
2511 o person
2502 |
2512 |
2503 o 1
2513 o 1
2504 |
2514 |
2505 o 1
2515 o 1
2506
2516
2507
2517
2508 Test word third parameter used as splitter
2518 Test word third parameter used as splitter
2509
2519
2510 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
2520 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
2511 @ future
2521 @ future
2512 |
2522 |
2513 o third
2523 o third
2514 |
2524 |
2515 o sec
2525 o sec
2516
2526
2517 o merge
2527 o merge
2518 |\
2528 |\
2519 | o new head
2529 | o new head
2520 | |
2530 | |
2521 o | new branch
2531 o | new branch
2522 |/
2532 |/
2523 o n
2533 o n
2524 |
2534 |
2525 o n
2535 o n
2526 |
2536 |
2527 o
2537 o
2528 |
2538 |
2529 o line 1
2539 o line 1
2530 line 2
2540 line 2
2531
2541
2532 Test word error messages for not enough and too many arguments
2542 Test word error messages for not enough and too many arguments
2533
2543
2534 $ hg log -Gv -R a --template "{word('0')}"
2544 $ hg log -Gv -R a --template "{word('0')}"
2535 hg: parse error: word expects two or three arguments, got 1
2545 hg: parse error: word expects two or three arguments, got 1
2536 [255]
2546 [255]
2537
2547
2538 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
2548 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
2539 hg: parse error: word expects two or three arguments, got 7
2549 hg: parse error: word expects two or three arguments, got 7
2540 [255]
2550 [255]
General Comments 0
You need to be logged in to leave comments. Login now