##// END OF EJS Templates
templater: fix output instability from gsoc patches
Augie Fackler -
r19127:d982edcf default
parent child Browse files
Show More
@@ -1,531 +1,531 b''
1 1 # templater.py - template expansion for output
2 2 #
3 3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from i18n import _
9 9 import sys, os, re
10 10 import util, config, templatefilters, parser, error
11 11 import types
12 12 import minirst
13 13
14 14 # template parsing
15 15
16 16 elements = {
17 17 "(": (20, ("group", 1, ")"), ("func", 1, ")")),
18 18 ",": (2, None, ("list", 2)),
19 19 "|": (5, None, ("|", 5)),
20 20 "%": (6, None, ("%", 6)),
21 21 ")": (0, None, None),
22 22 "symbol": (0, ("symbol",), None),
23 23 "string": (0, ("string",), None),
24 24 "end": (0, None, None),
25 25 }
26 26
27 27 def tokenizer(data):
28 28 program, start, end = data
29 29 pos = start
30 30 while pos < end:
31 31 c = program[pos]
32 32 if c.isspace(): # skip inter-token whitespace
33 33 pass
34 34 elif c in "(,)%|": # handle simple operators
35 35 yield (c, None, pos)
36 36 elif (c in '"\'' or c == 'r' and
37 37 program[pos:pos + 2] in ("r'", 'r"')): # handle quoted strings
38 38 if c == 'r':
39 39 pos += 1
40 40 c = program[pos]
41 41 decode = False
42 42 else:
43 43 decode = True
44 44 pos += 1
45 45 s = pos
46 46 while pos < end: # find closing quote
47 47 d = program[pos]
48 48 if decode and d == '\\': # skip over escaped characters
49 49 pos += 2
50 50 continue
51 51 if d == c:
52 52 if not decode:
53 53 yield ('string', program[s:pos].replace('\\', r'\\'), s)
54 54 break
55 55 yield ('string', program[s:pos].decode('string-escape'), s)
56 56 break
57 57 pos += 1
58 58 else:
59 59 raise error.ParseError(_("unterminated string"), s)
60 60 elif c.isalnum() or c in '_':
61 61 s = pos
62 62 pos += 1
63 63 while pos < end: # find end of symbol
64 64 d = program[pos]
65 65 if not (d.isalnum() or d == "_"):
66 66 break
67 67 pos += 1
68 68 sym = program[s:pos]
69 69 yield ('symbol', sym, s)
70 70 pos -= 1
71 71 elif c == '}':
72 72 pos += 1
73 73 break
74 74 else:
75 75 raise error.ParseError(_("syntax error"), pos)
76 76 pos += 1
77 77 yield ('end', None, pos)
78 78
79 79 def compiletemplate(tmpl, context):
80 80 parsed = []
81 81 pos, stop = 0, len(tmpl)
82 82 p = parser.parser(tokenizer, elements)
83 83
84 84 while pos < stop:
85 85 n = tmpl.find('{', pos)
86 86 if n < 0:
87 87 parsed.append(("string", tmpl[pos:]))
88 88 break
89 89 if n > 0 and tmpl[n - 1] == '\\':
90 90 # escaped
91 91 parsed.append(("string", tmpl[pos:n - 1] + "{"))
92 92 pos = n + 1
93 93 continue
94 94 if n > pos:
95 95 parsed.append(("string", tmpl[pos:n]))
96 96
97 97 pd = [tmpl, n + 1, stop]
98 98 parseres, pos = p.parse(pd)
99 99 parsed.append(parseres)
100 100
101 101 return [compileexp(e, context) for e in parsed]
102 102
103 103 def compileexp(exp, context):
104 104 t = exp[0]
105 105 if t in methods:
106 106 return methods[t](exp, context)
107 107 raise error.ParseError(_("unknown method '%s'") % t)
108 108
109 109 # template evaluation
110 110
111 111 def getsymbol(exp):
112 112 if exp[0] == 'symbol':
113 113 return exp[1]
114 114 raise error.ParseError(_("expected a symbol"))
115 115
116 116 def getlist(x):
117 117 if not x:
118 118 return []
119 119 if x[0] == 'list':
120 120 return getlist(x[1]) + [x[2]]
121 121 return [x]
122 122
123 123 def getfilter(exp, context):
124 124 f = getsymbol(exp)
125 125 if f not in context._filters:
126 126 raise error.ParseError(_("unknown function '%s'") % f)
127 127 return context._filters[f]
128 128
129 129 def gettemplate(exp, context):
130 130 if exp[0] == 'string':
131 131 return compiletemplate(exp[1], context)
132 132 if exp[0] == 'symbol':
133 133 return context._load(exp[1])
134 134 raise error.ParseError(_("expected template specifier"))
135 135
136 136 def runstring(context, mapping, data):
137 137 return data
138 138
139 139 def runsymbol(context, mapping, key):
140 140 v = mapping.get(key)
141 141 if v is None:
142 142 v = context._defaults.get(key, '')
143 143 if util.safehasattr(v, '__call__'):
144 144 return v(**mapping)
145 145 if isinstance(v, types.GeneratorType):
146 146 v = list(v)
147 147 mapping[key] = v
148 148 return v
149 149 return v
150 150
151 151 def buildfilter(exp, context):
152 152 func, data = compileexp(exp[1], context)
153 153 filt = getfilter(exp[2], context)
154 154 return (runfilter, (func, data, filt))
155 155
156 156 def runfilter(context, mapping, data):
157 157 func, data, filt = data
158 158 try:
159 159 return filt(func(context, mapping, data))
160 160 except (ValueError, AttributeError, TypeError):
161 161 if isinstance(data, tuple):
162 162 dt = data[1]
163 163 else:
164 164 dt = data
165 165 raise util.Abort(_("template filter '%s' is not compatible with "
166 166 "keyword '%s'") % (filt.func_name, dt))
167 167
168 168 def buildmap(exp, context):
169 169 func, data = compileexp(exp[1], context)
170 170 ctmpl = gettemplate(exp[2], context)
171 171 return (runmap, (func, data, ctmpl))
172 172
173 173 def runtemplate(context, mapping, template):
174 174 for func, data in template:
175 175 yield func(context, mapping, data)
176 176
177 177 def runmap(context, mapping, data):
178 178 func, data, ctmpl = data
179 179 d = func(context, mapping, data)
180 180 if util.safehasattr(d, '__call__'):
181 181 d = d()
182 182
183 183 lm = mapping.copy()
184 184
185 185 for i in d:
186 186 if isinstance(i, dict):
187 187 lm.update(i)
188 188 lm['originalnode'] = mapping.get('node')
189 189 yield runtemplate(context, lm, ctmpl)
190 190 else:
191 191 # v is not an iterable of dicts, this happen when 'key'
192 192 # has been fully expanded already and format is useless.
193 193 # If so, return the expanded value.
194 194 yield i
195 195
196 196 def buildfunc(exp, context):
197 197 n = getsymbol(exp[1])
198 198 args = [compileexp(x, context) for x in getlist(exp[2])]
199 199 if n in funcs:
200 200 f = funcs[n]
201 201 return (f, args)
202 202 if n in templatefilters.funcs:
203 203 f = templatefilters.funcs[n]
204 204 return (f, args)
205 205 if n in context._filters:
206 206 if len(args) != 1:
207 207 raise error.ParseError(_("filter %s expects one argument") % n)
208 208 f = context._filters[n]
209 209 return (runfilter, (args[0][0], args[0][1], f))
210 210
211 211 def get(context, mapping, args):
212 212 if len(args) != 2:
213 213 # i18n: "get" is a keyword
214 214 raise error.ParseError(_("get() expects two arguments"))
215 215
216 216 dictarg = args[0][0](context, mapping, args[0][1])
217 217 if not util.safehasattr(dictarg, 'get'):
218 218 # i18n: "get" is a keyword
219 219 raise error.ParseError(_("get() expects a dict as first argument"))
220 220
221 221 key = args[1][0](context, mapping, args[1][1])
222 222 yield dictarg.get(key)
223 223
224 224 def join(context, mapping, args):
225 225 if not (1 <= len(args) <= 2):
226 226 # i18n: "join" is a keyword
227 227 raise error.ParseError(_("join expects one or two arguments"))
228 228
229 229 joinset = args[0][0](context, mapping, args[0][1])
230 230 if util.safehasattr(joinset, '__call__'):
231 231 jf = joinset.joinfmt
232 232 joinset = [jf(x) for x in joinset()]
233 233
234 234 joiner = " "
235 235 if len(args) > 1:
236 236 joiner = args[1][0](context, mapping, args[1][1])
237 237
238 238 first = True
239 239 for x in joinset:
240 240 if first:
241 241 first = False
242 242 else:
243 243 yield joiner
244 244 yield x
245 245
246 246 def sub(context, mapping, args):
247 247 if len(args) != 3:
248 248 # i18n: "sub" is a keyword
249 249 raise error.ParseError(_("sub expects three arguments"))
250 250
251 251 pat = stringify(args[0][0](context, mapping, args[0][1]))
252 252 rpl = stringify(args[1][0](context, mapping, args[1][1]))
253 253 src = stringify(args[2][0](context, mapping, args[2][1]))
254 254 src = stringify(runtemplate(context, mapping,
255 255 compiletemplate(src, context)))
256 256 yield re.sub(pat, rpl, src)
257 257
258 258 def if_(context, mapping, args):
259 259 if not (2 <= len(args) <= 3):
260 260 # i18n: "if" is a keyword
261 261 raise error.ParseError(_("if expects two or three arguments"))
262 262
263 263 test = stringify(args[0][0](context, mapping, args[0][1]))
264 264 if test:
265 265 t = stringify(args[1][0](context, mapping, args[1][1]))
266 266 yield runtemplate(context, mapping, compiletemplate(t, context))
267 267 elif len(args) == 3:
268 268 t = stringify(args[2][0](context, mapping, args[2][1]))
269 269 yield runtemplate(context, mapping, compiletemplate(t, context))
270 270
271 271 def ifeq(context, mapping, args):
272 272 if not (3 <= len(args) <= 4):
273 273 # i18n: "ifeq" is a keyword
274 274 raise error.ParseError(_("ifeq expects three or four arguments"))
275 275
276 276 test = stringify(args[0][0](context, mapping, args[0][1]))
277 277 match = stringify(args[1][0](context, mapping, args[1][1]))
278 278 if test == match:
279 279 t = stringify(args[2][0](context, mapping, args[2][1]))
280 280 yield runtemplate(context, mapping, compiletemplate(t, context))
281 281 elif len(args) == 4:
282 282 t = stringify(args[3][0](context, mapping, args[3][1]))
283 283 yield runtemplate(context, mapping, compiletemplate(t, context))
284 284
285 285 def label(context, mapping, args):
286 286 if len(args) != 2:
287 287 # i18n: "label" is a keyword
288 288 raise error.ParseError(_("label expects two arguments"))
289 289
290 290 # ignore args[0] (the label string) since this is supposed to be a a no-op
291 291 t = stringify(args[1][0](context, mapping, args[1][1]))
292 292 yield runtemplate(context, mapping, compiletemplate(t, context))
293 293
294 294 def rstdoc(context, mapping, args):
295 295 if len(args) != 2:
296 296 # i18n: "rstdoc" is a keyword
297 297 raise error.ParseError(_("rstdoc expects two arguments"))
298 298
299 299 text = stringify(args[0][0](context, mapping, args[0][1]))
300 300 style = stringify(args[1][0](context, mapping, args[1][1]))
301 301
302 302 return minirst.format(text, style=style, keep=['verbose'])
303 303
304 304 methods = {
305 305 "string": lambda e, c: (runstring, e[1]),
306 306 "symbol": lambda e, c: (runsymbol, e[1]),
307 307 "group": lambda e, c: compileexp(e[1], c),
308 308 # ".": buildmember,
309 309 "|": buildfilter,
310 310 "%": buildmap,
311 311 "func": buildfunc,
312 312 }
313 313
314 314 funcs = {
315 315 "get": get,
316 316 "if": if_,
317 317 "ifeq": ifeq,
318 318 "join": join,
319 319 "label": label,
320 320 "rstdoc": rstdoc,
321 321 "sub": sub,
322 322 }
323 323
324 324 # template engine
325 325
326 326 path = ['templates', '../templates']
327 327 stringify = templatefilters.stringify
328 328
329 329 def _flatten(thing):
330 330 '''yield a single stream from a possibly nested set of iterators'''
331 331 if isinstance(thing, str):
332 332 yield thing
333 333 elif not util.safehasattr(thing, '__iter__'):
334 334 if thing is not None:
335 335 yield str(thing)
336 336 else:
337 337 for i in thing:
338 338 if isinstance(i, str):
339 339 yield i
340 340 elif not util.safehasattr(i, '__iter__'):
341 341 if i is not None:
342 342 yield str(i)
343 343 elif i is not None:
344 344 for j in _flatten(i):
345 345 yield j
346 346
347 347 def parsestring(s, quoted=True):
348 348 '''parse a string using simple c-like syntax.
349 349 string must be in quotes if quoted is True.'''
350 350 if quoted:
351 351 if len(s) < 2 or s[0] != s[-1]:
352 352 raise SyntaxError(_('unmatched quotes'))
353 353 return s[1:-1].decode('string_escape')
354 354
355 355 return s.decode('string_escape')
356 356
357 357 class engine(object):
358 358 '''template expansion engine.
359 359
360 360 template expansion works like this. a map file contains key=value
361 361 pairs. if value is quoted, it is treated as string. otherwise, it
362 362 is treated as name of template file.
363 363
364 364 templater is asked to expand a key in map. it looks up key, and
365 365 looks for strings like this: {foo}. it expands {foo} by looking up
366 366 foo in map, and substituting it. expansion is recursive: it stops
367 367 when there is no more {foo} to replace.
368 368
369 369 expansion also allows formatting and filtering.
370 370
371 371 format uses key to expand each item in list. syntax is
372 372 {key%format}.
373 373
374 374 filter uses function to transform value. syntax is
375 375 {key|filter1|filter2|...}.'''
376 376
377 377 def __init__(self, loader, filters={}, defaults={}):
378 378 self._loader = loader
379 379 self._filters = filters
380 380 self._defaults = defaults
381 381 self._cache = {}
382 382
383 383 def _load(self, t):
384 384 '''load, parse, and cache a template'''
385 385 if t not in self._cache:
386 386 self._cache[t] = compiletemplate(self._loader(t), self)
387 387 return self._cache[t]
388 388
389 389 def process(self, t, mapping):
390 390 '''Perform expansion. t is name of map element to expand.
391 391 mapping contains added elements for use during expansion. Is a
392 392 generator.'''
393 393 return _flatten(runtemplate(self, mapping, self._load(t)))
394 394
395 395 engines = {'default': engine}
396 396
397 397 def stylelist():
398 398 path = templatepath()[0]
399 399 dirlist = os.listdir(path)
400 400 stylelist = []
401 401 for file in dirlist:
402 402 split = file.split(".")
403 403 if split[0] == "map-cmdline":
404 404 stylelist.append(split[1])
405 return ", ".join(stylelist)
405 return ", ".join(sorted(stylelist))
406 406
407 407 class templater(object):
408 408
409 409 def __init__(self, mapfile, filters={}, defaults={}, cache={},
410 410 minchunk=1024, maxchunk=65536):
411 411 '''set up template engine.
412 412 mapfile is name of file to read map definitions from.
413 413 filters is dict of functions. each transforms a value into another.
414 414 defaults is dict of default map definitions.'''
415 415 self.mapfile = mapfile or 'template'
416 416 self.cache = cache.copy()
417 417 self.map = {}
418 418 self.base = (mapfile and os.path.dirname(mapfile)) or ''
419 419 self.filters = templatefilters.filters.copy()
420 420 self.filters.update(filters)
421 421 self.defaults = defaults
422 422 self.minchunk, self.maxchunk = minchunk, maxchunk
423 423 self.ecache = {}
424 424
425 425 if not mapfile:
426 426 return
427 427 if not os.path.exists(mapfile):
428 428 raise util.Abort(_("style '%s' not found") % mapfile,
429 429 hint=_("available styles: %s") % stylelist())
430 430
431 431 conf = config.config()
432 432 conf.read(mapfile)
433 433
434 434 for key, val in conf[''].items():
435 435 if not val:
436 436 raise SyntaxError(_('%s: missing value') % conf.source('', key))
437 437 if val[0] in "'\"":
438 438 try:
439 439 self.cache[key] = parsestring(val)
440 440 except SyntaxError, inst:
441 441 raise SyntaxError('%s: %s' %
442 442 (conf.source('', key), inst.args[0]))
443 443 else:
444 444 val = 'default', val
445 445 if ':' in val[1]:
446 446 val = val[1].split(':', 1)
447 447 self.map[key] = val[0], os.path.join(self.base, val[1])
448 448
449 449 def __contains__(self, key):
450 450 return key in self.cache or key in self.map
451 451
452 452 def load(self, t):
453 453 '''Get the template for the given template name. Use a local cache.'''
454 454 if t not in self.cache:
455 455 try:
456 456 self.cache[t] = util.readfile(self.map[t][1])
457 457 except KeyError, inst:
458 458 raise util.Abort(_('"%s" not in template map') % inst.args[0])
459 459 except IOError, inst:
460 460 raise IOError(inst.args[0], _('template file %s: %s') %
461 461 (self.map[t][1], inst.args[1]))
462 462 return self.cache[t]
463 463
464 464 def __call__(self, t, **mapping):
465 465 ttype = t in self.map and self.map[t][0] or 'default'
466 466 if ttype not in self.ecache:
467 467 self.ecache[ttype] = engines[ttype](self.load,
468 468 self.filters, self.defaults)
469 469 proc = self.ecache[ttype]
470 470
471 471 stream = proc.process(t, mapping)
472 472 if self.minchunk:
473 473 stream = util.increasingchunks(stream, min=self.minchunk,
474 474 max=self.maxchunk)
475 475 return stream
476 476
477 477 def templatepath(name=None):
478 478 '''return location of template file or directory (if no name).
479 479 returns None if not found.'''
480 480 normpaths = []
481 481
482 482 # executable version (py2exe) doesn't support __file__
483 483 if util.mainfrozen():
484 484 module = sys.executable
485 485 else:
486 486 module = __file__
487 487 for f in path:
488 488 if f.startswith('/'):
489 489 p = f
490 490 else:
491 491 fl = f.split('/')
492 492 p = os.path.join(os.path.dirname(module), *fl)
493 493 if name:
494 494 p = os.path.join(p, name)
495 495 if name and os.path.exists(p):
496 496 return os.path.normpath(p)
497 497 elif os.path.isdir(p):
498 498 normpaths.append(os.path.normpath(p))
499 499
500 500 return normpaths
501 501
502 502 def stylemap(styles, paths=None):
503 503 """Return path to mapfile for a given style.
504 504
505 505 Searches mapfile in the following locations:
506 506 1. templatepath/style/map
507 507 2. templatepath/map-style
508 508 3. templatepath/map
509 509 """
510 510
511 511 if paths is None:
512 512 paths = templatepath()
513 513 elif isinstance(paths, str):
514 514 paths = [paths]
515 515
516 516 if isinstance(styles, str):
517 517 styles = [styles]
518 518
519 519 for style in styles:
520 520 if not style:
521 521 continue
522 522 locations = [os.path.join(style, 'map'), 'map-' + style]
523 523 locations.append('map')
524 524
525 525 for path in paths:
526 526 for location in locations:
527 527 mapfile = os.path.join(path, location)
528 528 if os.path.isfile(mapfile):
529 529 return style, mapfile
530 530
531 531 raise RuntimeError("No hgweb templates found in %r" % paths)
@@ -1,1537 +1,1538 b''
1 1 $ hg init a
2 2 $ cd a
3 3 $ echo a > a
4 4 $ hg add a
5 5 $ echo line 1 > b
6 6 $ echo line 2 >> b
7 7 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
8 8
9 9 $ hg add b
10 10 $ echo other 1 > c
11 11 $ echo other 2 >> c
12 12 $ echo >> c
13 13 $ echo other 3 >> c
14 14 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
15 15
16 16 $ hg add c
17 17 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
18 18 $ echo c >> c
19 19 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
20 20
21 21 $ echo foo > .hg/branch
22 22 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
23 23
24 24 $ hg co -q 3
25 25 $ echo other 4 >> d
26 26 $ hg add d
27 27 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
28 28
29 29 $ hg merge -q foo
30 30 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
31 31
32 32 Second branch starting at nullrev:
33 33
34 34 $ hg update null
35 35 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
36 36 $ echo second > second
37 37 $ hg add second
38 38 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
39 39 created new head
40 40
41 41 $ echo third > third
42 42 $ hg add third
43 43 $ hg mv second fourth
44 44 $ hg commit -m third -d "2020-01-01 10:01"
45 45
46 46 $ hg log --template '{join(file_copies, ",\n")}\n' -r .
47 47 fourth (second)
48 48 $ hg log --template '{file_copies % "{source} -> {name}\n"}' -r .
49 49 second -> fourth
50 50
51 51 Quoting for ui.logtemplate
52 52
53 53 $ hg tip --config "ui.logtemplate={rev}\n"
54 54 8
55 55 $ hg tip --config "ui.logtemplate='{rev}\n'"
56 56 8
57 57 $ hg tip --config 'ui.logtemplate="{rev}\n"'
58 58 8
59 59
60 60 Make sure user/global hgrc does not affect tests
61 61
62 62 $ echo '[ui]' > .hg/hgrc
63 63 $ echo 'logtemplate =' >> .hg/hgrc
64 64 $ echo 'style =' >> .hg/hgrc
65 65
66 66 Default style is like normal output:
67 67
68 68 $ hg log > log.out
69 69 $ hg log --style default > style.out
70 70 $ cmp log.out style.out || diff -u log.out style.out
71 71
72 72 $ hg log -v > log.out
73 73 $ hg log -v --style default > style.out
74 74 $ cmp log.out style.out || diff -u log.out style.out
75 75
76 76 $ hg log --debug > log.out
77 77 $ hg log --debug --style default > style.out
78 78 $ cmp log.out style.out || diff -u log.out style.out
79 79
80 80 Revision with no copies (used to print a traceback):
81 81
82 82 $ hg tip -v --template '\n'
83 83
84 84
85 85 Compact style works:
86 86
87 87 $ hg log --style compact
88 88 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
89 89 third
90 90
91 91 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
92 92 second
93 93
94 94 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
95 95 merge
96 96
97 97 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
98 98 new head
99 99
100 100 4 bbe44766e73d 1970-01-17 04:53 +0000 person
101 101 new branch
102 102
103 103 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
104 104 no user, no domain
105 105
106 106 2 97054abb4ab8 1970-01-14 21:20 +0000 other
107 107 no person
108 108
109 109 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
110 110 other 1
111 111
112 112 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
113 113 line 1
114 114
115 115
116 116 $ hg log -v --style compact
117 117 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
118 118 third
119 119
120 120 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
121 121 second
122 122
123 123 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
124 124 merge
125 125
126 126 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
127 127 new head
128 128
129 129 4 bbe44766e73d 1970-01-17 04:53 +0000 person
130 130 new branch
131 131
132 132 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
133 133 no user, no domain
134 134
135 135 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
136 136 no person
137 137
138 138 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
139 139 other 1
140 140 other 2
141 141
142 142 other 3
143 143
144 144 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
145 145 line 1
146 146 line 2
147 147
148 148
149 149 $ hg log --debug --style compact
150 150 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
151 151 third
152 152
153 153 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
154 154 second
155 155
156 156 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
157 157 merge
158 158
159 159 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
160 160 new head
161 161
162 162 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
163 163 new branch
164 164
165 165 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
166 166 no user, no domain
167 167
168 168 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
169 169 no person
170 170
171 171 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
172 172 other 1
173 173 other 2
174 174
175 175 other 3
176 176
177 177 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
178 178 line 1
179 179 line 2
180 180
181 181
182 182 Test xml styles:
183 183
184 184 $ hg log --style xml
185 185 <?xml version="1.0"?>
186 186 <log>
187 187 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
188 188 <tag>tip</tag>
189 189 <author email="test">test</author>
190 190 <date>2020-01-01T10:01:00+00:00</date>
191 191 <msg xml:space="preserve">third</msg>
192 192 </logentry>
193 193 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
194 194 <parent revision="-1" node="0000000000000000000000000000000000000000" />
195 195 <author email="user@hostname">User Name</author>
196 196 <date>1970-01-12T13:46:40+00:00</date>
197 197 <msg xml:space="preserve">second</msg>
198 198 </logentry>
199 199 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
200 200 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
201 201 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
202 202 <author email="person">person</author>
203 203 <date>1970-01-18T08:40:01+00:00</date>
204 204 <msg xml:space="preserve">merge</msg>
205 205 </logentry>
206 206 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
207 207 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
208 208 <author email="person">person</author>
209 209 <date>1970-01-18T08:40:00+00:00</date>
210 210 <msg xml:space="preserve">new head</msg>
211 211 </logentry>
212 212 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
213 213 <branch>foo</branch>
214 214 <author email="person">person</author>
215 215 <date>1970-01-17T04:53:20+00:00</date>
216 216 <msg xml:space="preserve">new branch</msg>
217 217 </logentry>
218 218 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
219 219 <author email="person">person</author>
220 220 <date>1970-01-16T01:06:40+00:00</date>
221 221 <msg xml:space="preserve">no user, no domain</msg>
222 222 </logentry>
223 223 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
224 224 <author email="other@place">other</author>
225 225 <date>1970-01-14T21:20:00+00:00</date>
226 226 <msg xml:space="preserve">no person</msg>
227 227 </logentry>
228 228 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
229 229 <author email="other@place">A. N. Other</author>
230 230 <date>1970-01-13T17:33:20+00:00</date>
231 231 <msg xml:space="preserve">other 1
232 232 other 2
233 233
234 234 other 3</msg>
235 235 </logentry>
236 236 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
237 237 <author email="user@hostname">User Name</author>
238 238 <date>1970-01-12T13:46:40+00:00</date>
239 239 <msg xml:space="preserve">line 1
240 240 line 2</msg>
241 241 </logentry>
242 242 </log>
243 243
244 244 $ hg log -v --style xml
245 245 <?xml version="1.0"?>
246 246 <log>
247 247 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
248 248 <tag>tip</tag>
249 249 <author email="test">test</author>
250 250 <date>2020-01-01T10:01:00+00:00</date>
251 251 <msg xml:space="preserve">third</msg>
252 252 <paths>
253 253 <path action="A">fourth</path>
254 254 <path action="A">third</path>
255 255 <path action="R">second</path>
256 256 </paths>
257 257 <copies>
258 258 <copy source="second">fourth</copy>
259 259 </copies>
260 260 </logentry>
261 261 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
262 262 <parent revision="-1" node="0000000000000000000000000000000000000000" />
263 263 <author email="user@hostname">User Name</author>
264 264 <date>1970-01-12T13:46:40+00:00</date>
265 265 <msg xml:space="preserve">second</msg>
266 266 <paths>
267 267 <path action="A">second</path>
268 268 </paths>
269 269 </logentry>
270 270 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
271 271 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
272 272 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
273 273 <author email="person">person</author>
274 274 <date>1970-01-18T08:40:01+00:00</date>
275 275 <msg xml:space="preserve">merge</msg>
276 276 <paths>
277 277 </paths>
278 278 </logentry>
279 279 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
280 280 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
281 281 <author email="person">person</author>
282 282 <date>1970-01-18T08:40:00+00:00</date>
283 283 <msg xml:space="preserve">new head</msg>
284 284 <paths>
285 285 <path action="A">d</path>
286 286 </paths>
287 287 </logentry>
288 288 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
289 289 <branch>foo</branch>
290 290 <author email="person">person</author>
291 291 <date>1970-01-17T04:53:20+00:00</date>
292 292 <msg xml:space="preserve">new branch</msg>
293 293 <paths>
294 294 </paths>
295 295 </logentry>
296 296 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
297 297 <author email="person">person</author>
298 298 <date>1970-01-16T01:06:40+00:00</date>
299 299 <msg xml:space="preserve">no user, no domain</msg>
300 300 <paths>
301 301 <path action="M">c</path>
302 302 </paths>
303 303 </logentry>
304 304 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
305 305 <author email="other@place">other</author>
306 306 <date>1970-01-14T21:20:00+00:00</date>
307 307 <msg xml:space="preserve">no person</msg>
308 308 <paths>
309 309 <path action="A">c</path>
310 310 </paths>
311 311 </logentry>
312 312 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
313 313 <author email="other@place">A. N. Other</author>
314 314 <date>1970-01-13T17:33:20+00:00</date>
315 315 <msg xml:space="preserve">other 1
316 316 other 2
317 317
318 318 other 3</msg>
319 319 <paths>
320 320 <path action="A">b</path>
321 321 </paths>
322 322 </logentry>
323 323 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
324 324 <author email="user@hostname">User Name</author>
325 325 <date>1970-01-12T13:46:40+00:00</date>
326 326 <msg xml:space="preserve">line 1
327 327 line 2</msg>
328 328 <paths>
329 329 <path action="A">a</path>
330 330 </paths>
331 331 </logentry>
332 332 </log>
333 333
334 334 $ hg log --debug --style xml
335 335 <?xml version="1.0"?>
336 336 <log>
337 337 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
338 338 <tag>tip</tag>
339 339 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
340 340 <parent revision="-1" node="0000000000000000000000000000000000000000" />
341 341 <author email="test">test</author>
342 342 <date>2020-01-01T10:01:00+00:00</date>
343 343 <msg xml:space="preserve">third</msg>
344 344 <paths>
345 345 <path action="A">fourth</path>
346 346 <path action="A">third</path>
347 347 <path action="R">second</path>
348 348 </paths>
349 349 <copies>
350 350 <copy source="second">fourth</copy>
351 351 </copies>
352 352 <extra key="branch">default</extra>
353 353 </logentry>
354 354 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
355 355 <parent revision="-1" node="0000000000000000000000000000000000000000" />
356 356 <parent revision="-1" node="0000000000000000000000000000000000000000" />
357 357 <author email="user@hostname">User Name</author>
358 358 <date>1970-01-12T13:46:40+00:00</date>
359 359 <msg xml:space="preserve">second</msg>
360 360 <paths>
361 361 <path action="A">second</path>
362 362 </paths>
363 363 <extra key="branch">default</extra>
364 364 </logentry>
365 365 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
366 366 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
367 367 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
368 368 <author email="person">person</author>
369 369 <date>1970-01-18T08:40:01+00:00</date>
370 370 <msg xml:space="preserve">merge</msg>
371 371 <paths>
372 372 </paths>
373 373 <extra key="branch">default</extra>
374 374 </logentry>
375 375 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
376 376 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
377 377 <parent revision="-1" node="0000000000000000000000000000000000000000" />
378 378 <author email="person">person</author>
379 379 <date>1970-01-18T08:40:00+00:00</date>
380 380 <msg xml:space="preserve">new head</msg>
381 381 <paths>
382 382 <path action="A">d</path>
383 383 </paths>
384 384 <extra key="branch">default</extra>
385 385 </logentry>
386 386 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
387 387 <branch>foo</branch>
388 388 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
389 389 <parent revision="-1" node="0000000000000000000000000000000000000000" />
390 390 <author email="person">person</author>
391 391 <date>1970-01-17T04:53:20+00:00</date>
392 392 <msg xml:space="preserve">new branch</msg>
393 393 <paths>
394 394 </paths>
395 395 <extra key="branch">foo</extra>
396 396 </logentry>
397 397 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
398 398 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
399 399 <parent revision="-1" node="0000000000000000000000000000000000000000" />
400 400 <author email="person">person</author>
401 401 <date>1970-01-16T01:06:40+00:00</date>
402 402 <msg xml:space="preserve">no user, no domain</msg>
403 403 <paths>
404 404 <path action="M">c</path>
405 405 </paths>
406 406 <extra key="branch">default</extra>
407 407 </logentry>
408 408 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
409 409 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
410 410 <parent revision="-1" node="0000000000000000000000000000000000000000" />
411 411 <author email="other@place">other</author>
412 412 <date>1970-01-14T21:20:00+00:00</date>
413 413 <msg xml:space="preserve">no person</msg>
414 414 <paths>
415 415 <path action="A">c</path>
416 416 </paths>
417 417 <extra key="branch">default</extra>
418 418 </logentry>
419 419 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
420 420 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
421 421 <parent revision="-1" node="0000000000000000000000000000000000000000" />
422 422 <author email="other@place">A. N. Other</author>
423 423 <date>1970-01-13T17:33:20+00:00</date>
424 424 <msg xml:space="preserve">other 1
425 425 other 2
426 426
427 427 other 3</msg>
428 428 <paths>
429 429 <path action="A">b</path>
430 430 </paths>
431 431 <extra key="branch">default</extra>
432 432 </logentry>
433 433 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
434 434 <parent revision="-1" node="0000000000000000000000000000000000000000" />
435 435 <parent revision="-1" node="0000000000000000000000000000000000000000" />
436 436 <author email="user@hostname">User Name</author>
437 437 <date>1970-01-12T13:46:40+00:00</date>
438 438 <msg xml:space="preserve">line 1
439 439 line 2</msg>
440 440 <paths>
441 441 <path action="A">a</path>
442 442 </paths>
443 443 <extra key="branch">default</extra>
444 444 </logentry>
445 445 </log>
446 446
447 447
448 448 Error if style not readable:
449 449
450 450 #if unix-permissions
451 451 $ touch q
452 452 $ chmod 0 q
453 453 $ hg log --style ./q
454 454 abort: Permission denied: ./q
455 455 [255]
456 456 #endif
457 457
458 458 Error if no style:
459 459
460 460 $ hg log --style notexist
461 abort: style not found: notexist
461 abort: style 'notexist' not found
462 (available styles: bisect, changelog, compact, default, phases, xml)
462 463 [255]
463 464
464 465 Error if style missing key:
465 466
466 467 $ echo 'q = q' > t
467 468 $ hg log --style ./t
468 469 abort: "changeset" not in template map
469 470 [255]
470 471
471 472 Error if style missing value:
472 473
473 474 $ echo 'changeset =' > t
474 475 $ hg log --style t
475 476 abort: t:1: missing value
476 477 [255]
477 478
478 479 Error if include fails:
479 480
480 481 $ echo 'changeset = q' >> t
481 482 #if unix-permissions
482 483 $ hg log --style ./t
483 484 abort: template file ./q: Permission denied
484 485 [255]
485 486 $ rm q
486 487 #endif
487 488
488 489 Include works:
489 490
490 491 $ echo '{rev}' > q
491 492 $ hg log --style ./t
492 493 8
493 494 7
494 495 6
495 496 5
496 497 4
497 498 3
498 499 2
499 500 1
500 501 0
501 502
502 503 ui.style works:
503 504
504 505 $ echo '[ui]' > .hg/hgrc
505 506 $ echo 'style = t' >> .hg/hgrc
506 507 $ hg log
507 508 8
508 509 7
509 510 6
510 511 5
511 512 4
512 513 3
513 514 2
514 515 1
515 516 0
516 517
517 518
518 519 Issue338:
519 520
520 521 $ hg log --style=changelog > changelog
521 522
522 523 $ cat changelog
523 524 2020-01-01 test <test>
524 525
525 526 * fourth, second, third:
526 527 third
527 528 [95c24699272e] [tip]
528 529
529 530 1970-01-12 User Name <user@hostname>
530 531
531 532 * second:
532 533 second
533 534 [29114dbae42b]
534 535
535 536 1970-01-18 person <person>
536 537
537 538 * merge
538 539 [d41e714fe50d]
539 540
540 541 * d:
541 542 new head
542 543 [13207e5a10d9]
543 544
544 545 1970-01-17 person <person>
545 546
546 547 * new branch
547 548 [bbe44766e73d] <foo>
548 549
549 550 1970-01-16 person <person>
550 551
551 552 * c:
552 553 no user, no domain
553 554 [10e46f2dcbf4]
554 555
555 556 1970-01-14 other <other@place>
556 557
557 558 * c:
558 559 no person
559 560 [97054abb4ab8]
560 561
561 562 1970-01-13 A. N. Other <other@place>
562 563
563 564 * b:
564 565 other 1 other 2
565 566
566 567 other 3
567 568 [b608e9d1a3f0]
568 569
569 570 1970-01-12 User Name <user@hostname>
570 571
571 572 * a:
572 573 line 1 line 2
573 574 [1e4e1b8f71e0]
574 575
575 576
576 577 Issue2130: xml output for 'hg heads' is malformed
577 578
578 579 $ hg heads --style changelog
579 580 2020-01-01 test <test>
580 581
581 582 * fourth, second, third:
582 583 third
583 584 [95c24699272e] [tip]
584 585
585 586 1970-01-18 person <person>
586 587
587 588 * merge
588 589 [d41e714fe50d]
589 590
590 591 1970-01-17 person <person>
591 592
592 593 * new branch
593 594 [bbe44766e73d] <foo>
594 595
595 596
596 597 Keys work:
597 598
598 599 $ for key in author branch branches date desc file_adds file_dels file_mods \
599 600 > file_copies file_copies_switch files \
600 601 > manifest node parents rev tags diffstat extras \
601 602 > p1rev p2rev p1node p2node; do
602 603 > for mode in '' --verbose --debug; do
603 604 > hg log $mode --template "$key$mode: {$key}\n"
604 605 > done
605 606 > done
606 607 author: test
607 608 author: User Name <user@hostname>
608 609 author: person
609 610 author: person
610 611 author: person
611 612 author: person
612 613 author: other@place
613 614 author: A. N. Other <other@place>
614 615 author: User Name <user@hostname>
615 616 author--verbose: test
616 617 author--verbose: User Name <user@hostname>
617 618 author--verbose: person
618 619 author--verbose: person
619 620 author--verbose: person
620 621 author--verbose: person
621 622 author--verbose: other@place
622 623 author--verbose: A. N. Other <other@place>
623 624 author--verbose: User Name <user@hostname>
624 625 author--debug: test
625 626 author--debug: User Name <user@hostname>
626 627 author--debug: person
627 628 author--debug: person
628 629 author--debug: person
629 630 author--debug: person
630 631 author--debug: other@place
631 632 author--debug: A. N. Other <other@place>
632 633 author--debug: User Name <user@hostname>
633 634 branch: default
634 635 branch: default
635 636 branch: default
636 637 branch: default
637 638 branch: foo
638 639 branch: default
639 640 branch: default
640 641 branch: default
641 642 branch: default
642 643 branch--verbose: default
643 644 branch--verbose: default
644 645 branch--verbose: default
645 646 branch--verbose: default
646 647 branch--verbose: foo
647 648 branch--verbose: default
648 649 branch--verbose: default
649 650 branch--verbose: default
650 651 branch--verbose: default
651 652 branch--debug: default
652 653 branch--debug: default
653 654 branch--debug: default
654 655 branch--debug: default
655 656 branch--debug: foo
656 657 branch--debug: default
657 658 branch--debug: default
658 659 branch--debug: default
659 660 branch--debug: default
660 661 branches:
661 662 branches:
662 663 branches:
663 664 branches:
664 665 branches: foo
665 666 branches:
666 667 branches:
667 668 branches:
668 669 branches:
669 670 branches--verbose:
670 671 branches--verbose:
671 672 branches--verbose:
672 673 branches--verbose:
673 674 branches--verbose: foo
674 675 branches--verbose:
675 676 branches--verbose:
676 677 branches--verbose:
677 678 branches--verbose:
678 679 branches--debug:
679 680 branches--debug:
680 681 branches--debug:
681 682 branches--debug:
682 683 branches--debug: foo
683 684 branches--debug:
684 685 branches--debug:
685 686 branches--debug:
686 687 branches--debug:
687 688 date: 1577872860.00
688 689 date: 1000000.00
689 690 date: 1500001.00
690 691 date: 1500000.00
691 692 date: 1400000.00
692 693 date: 1300000.00
693 694 date: 1200000.00
694 695 date: 1100000.00
695 696 date: 1000000.00
696 697 date--verbose: 1577872860.00
697 698 date--verbose: 1000000.00
698 699 date--verbose: 1500001.00
699 700 date--verbose: 1500000.00
700 701 date--verbose: 1400000.00
701 702 date--verbose: 1300000.00
702 703 date--verbose: 1200000.00
703 704 date--verbose: 1100000.00
704 705 date--verbose: 1000000.00
705 706 date--debug: 1577872860.00
706 707 date--debug: 1000000.00
707 708 date--debug: 1500001.00
708 709 date--debug: 1500000.00
709 710 date--debug: 1400000.00
710 711 date--debug: 1300000.00
711 712 date--debug: 1200000.00
712 713 date--debug: 1100000.00
713 714 date--debug: 1000000.00
714 715 desc: third
715 716 desc: second
716 717 desc: merge
717 718 desc: new head
718 719 desc: new branch
719 720 desc: no user, no domain
720 721 desc: no person
721 722 desc: other 1
722 723 other 2
723 724
724 725 other 3
725 726 desc: line 1
726 727 line 2
727 728 desc--verbose: third
728 729 desc--verbose: second
729 730 desc--verbose: merge
730 731 desc--verbose: new head
731 732 desc--verbose: new branch
732 733 desc--verbose: no user, no domain
733 734 desc--verbose: no person
734 735 desc--verbose: other 1
735 736 other 2
736 737
737 738 other 3
738 739 desc--verbose: line 1
739 740 line 2
740 741 desc--debug: third
741 742 desc--debug: second
742 743 desc--debug: merge
743 744 desc--debug: new head
744 745 desc--debug: new branch
745 746 desc--debug: no user, no domain
746 747 desc--debug: no person
747 748 desc--debug: other 1
748 749 other 2
749 750
750 751 other 3
751 752 desc--debug: line 1
752 753 line 2
753 754 file_adds: fourth third
754 755 file_adds: second
755 756 file_adds:
756 757 file_adds: d
757 758 file_adds:
758 759 file_adds:
759 760 file_adds: c
760 761 file_adds: b
761 762 file_adds: a
762 763 file_adds--verbose: fourth third
763 764 file_adds--verbose: second
764 765 file_adds--verbose:
765 766 file_adds--verbose: d
766 767 file_adds--verbose:
767 768 file_adds--verbose:
768 769 file_adds--verbose: c
769 770 file_adds--verbose: b
770 771 file_adds--verbose: a
771 772 file_adds--debug: fourth third
772 773 file_adds--debug: second
773 774 file_adds--debug:
774 775 file_adds--debug: d
775 776 file_adds--debug:
776 777 file_adds--debug:
777 778 file_adds--debug: c
778 779 file_adds--debug: b
779 780 file_adds--debug: a
780 781 file_dels: second
781 782 file_dels:
782 783 file_dels:
783 784 file_dels:
784 785 file_dels:
785 786 file_dels:
786 787 file_dels:
787 788 file_dels:
788 789 file_dels:
789 790 file_dels--verbose: second
790 791 file_dels--verbose:
791 792 file_dels--verbose:
792 793 file_dels--verbose:
793 794 file_dels--verbose:
794 795 file_dels--verbose:
795 796 file_dels--verbose:
796 797 file_dels--verbose:
797 798 file_dels--verbose:
798 799 file_dels--debug: second
799 800 file_dels--debug:
800 801 file_dels--debug:
801 802 file_dels--debug:
802 803 file_dels--debug:
803 804 file_dels--debug:
804 805 file_dels--debug:
805 806 file_dels--debug:
806 807 file_dels--debug:
807 808 file_mods:
808 809 file_mods:
809 810 file_mods:
810 811 file_mods:
811 812 file_mods:
812 813 file_mods: c
813 814 file_mods:
814 815 file_mods:
815 816 file_mods:
816 817 file_mods--verbose:
817 818 file_mods--verbose:
818 819 file_mods--verbose:
819 820 file_mods--verbose:
820 821 file_mods--verbose:
821 822 file_mods--verbose: c
822 823 file_mods--verbose:
823 824 file_mods--verbose:
824 825 file_mods--verbose:
825 826 file_mods--debug:
826 827 file_mods--debug:
827 828 file_mods--debug:
828 829 file_mods--debug:
829 830 file_mods--debug:
830 831 file_mods--debug: c
831 832 file_mods--debug:
832 833 file_mods--debug:
833 834 file_mods--debug:
834 835 file_copies: fourth (second)
835 836 file_copies:
836 837 file_copies:
837 838 file_copies:
838 839 file_copies:
839 840 file_copies:
840 841 file_copies:
841 842 file_copies:
842 843 file_copies:
843 844 file_copies--verbose: fourth (second)
844 845 file_copies--verbose:
845 846 file_copies--verbose:
846 847 file_copies--verbose:
847 848 file_copies--verbose:
848 849 file_copies--verbose:
849 850 file_copies--verbose:
850 851 file_copies--verbose:
851 852 file_copies--verbose:
852 853 file_copies--debug: fourth (second)
853 854 file_copies--debug:
854 855 file_copies--debug:
855 856 file_copies--debug:
856 857 file_copies--debug:
857 858 file_copies--debug:
858 859 file_copies--debug:
859 860 file_copies--debug:
860 861 file_copies--debug:
861 862 file_copies_switch:
862 863 file_copies_switch:
863 864 file_copies_switch:
864 865 file_copies_switch:
865 866 file_copies_switch:
866 867 file_copies_switch:
867 868 file_copies_switch:
868 869 file_copies_switch:
869 870 file_copies_switch:
870 871 file_copies_switch--verbose:
871 872 file_copies_switch--verbose:
872 873 file_copies_switch--verbose:
873 874 file_copies_switch--verbose:
874 875 file_copies_switch--verbose:
875 876 file_copies_switch--verbose:
876 877 file_copies_switch--verbose:
877 878 file_copies_switch--verbose:
878 879 file_copies_switch--verbose:
879 880 file_copies_switch--debug:
880 881 file_copies_switch--debug:
881 882 file_copies_switch--debug:
882 883 file_copies_switch--debug:
883 884 file_copies_switch--debug:
884 885 file_copies_switch--debug:
885 886 file_copies_switch--debug:
886 887 file_copies_switch--debug:
887 888 file_copies_switch--debug:
888 889 files: fourth second third
889 890 files: second
890 891 files:
891 892 files: d
892 893 files:
893 894 files: c
894 895 files: c
895 896 files: b
896 897 files: a
897 898 files--verbose: fourth second third
898 899 files--verbose: second
899 900 files--verbose:
900 901 files--verbose: d
901 902 files--verbose:
902 903 files--verbose: c
903 904 files--verbose: c
904 905 files--verbose: b
905 906 files--verbose: a
906 907 files--debug: fourth second third
907 908 files--debug: second
908 909 files--debug:
909 910 files--debug: d
910 911 files--debug:
911 912 files--debug: c
912 913 files--debug: c
913 914 files--debug: b
914 915 files--debug: a
915 916 manifest: 6:94961b75a2da
916 917 manifest: 5:f2dbc354b94e
917 918 manifest: 4:4dc3def4f9b4
918 919 manifest: 4:4dc3def4f9b4
919 920 manifest: 3:cb5a1327723b
920 921 manifest: 3:cb5a1327723b
921 922 manifest: 2:6e0e82995c35
922 923 manifest: 1:4e8d705b1e53
923 924 manifest: 0:a0c8bcbbb45c
924 925 manifest--verbose: 6:94961b75a2da
925 926 manifest--verbose: 5:f2dbc354b94e
926 927 manifest--verbose: 4:4dc3def4f9b4
927 928 manifest--verbose: 4:4dc3def4f9b4
928 929 manifest--verbose: 3:cb5a1327723b
929 930 manifest--verbose: 3:cb5a1327723b
930 931 manifest--verbose: 2:6e0e82995c35
931 932 manifest--verbose: 1:4e8d705b1e53
932 933 manifest--verbose: 0:a0c8bcbbb45c
933 934 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
934 935 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
935 936 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
936 937 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
937 938 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
938 939 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
939 940 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
940 941 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
941 942 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
942 943 node: 95c24699272ef57d062b8bccc32c878bf841784a
943 944 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
944 945 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
945 946 node: 13207e5a10d9fd28ec424934298e176197f2c67f
946 947 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
947 948 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
948 949 node: 97054abb4ab824450e9164180baf491ae0078465
949 950 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
950 951 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
951 952 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
952 953 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
953 954 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
954 955 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
955 956 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
956 957 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
957 958 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
958 959 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
959 960 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
960 961 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
961 962 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
962 963 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
963 964 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
964 965 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
965 966 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
966 967 node--debug: 97054abb4ab824450e9164180baf491ae0078465
967 968 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
968 969 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
969 970 parents:
970 971 parents: -1:000000000000
971 972 parents: 5:13207e5a10d9 4:bbe44766e73d
972 973 parents: 3:10e46f2dcbf4
973 974 parents:
974 975 parents:
975 976 parents:
976 977 parents:
977 978 parents:
978 979 parents--verbose:
979 980 parents--verbose: -1:000000000000
980 981 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
981 982 parents--verbose: 3:10e46f2dcbf4
982 983 parents--verbose:
983 984 parents--verbose:
984 985 parents--verbose:
985 986 parents--verbose:
986 987 parents--verbose:
987 988 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
988 989 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
989 990 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
990 991 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
991 992 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
992 993 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
993 994 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
994 995 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
995 996 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
996 997 rev: 8
997 998 rev: 7
998 999 rev: 6
999 1000 rev: 5
1000 1001 rev: 4
1001 1002 rev: 3
1002 1003 rev: 2
1003 1004 rev: 1
1004 1005 rev: 0
1005 1006 rev--verbose: 8
1006 1007 rev--verbose: 7
1007 1008 rev--verbose: 6
1008 1009 rev--verbose: 5
1009 1010 rev--verbose: 4
1010 1011 rev--verbose: 3
1011 1012 rev--verbose: 2
1012 1013 rev--verbose: 1
1013 1014 rev--verbose: 0
1014 1015 rev--debug: 8
1015 1016 rev--debug: 7
1016 1017 rev--debug: 6
1017 1018 rev--debug: 5
1018 1019 rev--debug: 4
1019 1020 rev--debug: 3
1020 1021 rev--debug: 2
1021 1022 rev--debug: 1
1022 1023 rev--debug: 0
1023 1024 tags: tip
1024 1025 tags:
1025 1026 tags:
1026 1027 tags:
1027 1028 tags:
1028 1029 tags:
1029 1030 tags:
1030 1031 tags:
1031 1032 tags:
1032 1033 tags--verbose: tip
1033 1034 tags--verbose:
1034 1035 tags--verbose:
1035 1036 tags--verbose:
1036 1037 tags--verbose:
1037 1038 tags--verbose:
1038 1039 tags--verbose:
1039 1040 tags--verbose:
1040 1041 tags--verbose:
1041 1042 tags--debug: tip
1042 1043 tags--debug:
1043 1044 tags--debug:
1044 1045 tags--debug:
1045 1046 tags--debug:
1046 1047 tags--debug:
1047 1048 tags--debug:
1048 1049 tags--debug:
1049 1050 tags--debug:
1050 1051 diffstat: 3: +2/-1
1051 1052 diffstat: 1: +1/-0
1052 1053 diffstat: 0: +0/-0
1053 1054 diffstat: 1: +1/-0
1054 1055 diffstat: 0: +0/-0
1055 1056 diffstat: 1: +1/-0
1056 1057 diffstat: 1: +4/-0
1057 1058 diffstat: 1: +2/-0
1058 1059 diffstat: 1: +1/-0
1059 1060 diffstat--verbose: 3: +2/-1
1060 1061 diffstat--verbose: 1: +1/-0
1061 1062 diffstat--verbose: 0: +0/-0
1062 1063 diffstat--verbose: 1: +1/-0
1063 1064 diffstat--verbose: 0: +0/-0
1064 1065 diffstat--verbose: 1: +1/-0
1065 1066 diffstat--verbose: 1: +4/-0
1066 1067 diffstat--verbose: 1: +2/-0
1067 1068 diffstat--verbose: 1: +1/-0
1068 1069 diffstat--debug: 3: +2/-1
1069 1070 diffstat--debug: 1: +1/-0
1070 1071 diffstat--debug: 0: +0/-0
1071 1072 diffstat--debug: 1: +1/-0
1072 1073 diffstat--debug: 0: +0/-0
1073 1074 diffstat--debug: 1: +1/-0
1074 1075 diffstat--debug: 1: +4/-0
1075 1076 diffstat--debug: 1: +2/-0
1076 1077 diffstat--debug: 1: +1/-0
1077 1078 extras: branch=default
1078 1079 extras: branch=default
1079 1080 extras: branch=default
1080 1081 extras: branch=default
1081 1082 extras: branch=foo
1082 1083 extras: branch=default
1083 1084 extras: branch=default
1084 1085 extras: branch=default
1085 1086 extras: branch=default
1086 1087 extras--verbose: branch=default
1087 1088 extras--verbose: branch=default
1088 1089 extras--verbose: branch=default
1089 1090 extras--verbose: branch=default
1090 1091 extras--verbose: branch=foo
1091 1092 extras--verbose: branch=default
1092 1093 extras--verbose: branch=default
1093 1094 extras--verbose: branch=default
1094 1095 extras--verbose: branch=default
1095 1096 extras--debug: branch=default
1096 1097 extras--debug: branch=default
1097 1098 extras--debug: branch=default
1098 1099 extras--debug: branch=default
1099 1100 extras--debug: branch=foo
1100 1101 extras--debug: branch=default
1101 1102 extras--debug: branch=default
1102 1103 extras--debug: branch=default
1103 1104 extras--debug: branch=default
1104 1105 p1rev: 7
1105 1106 p1rev: -1
1106 1107 p1rev: 5
1107 1108 p1rev: 3
1108 1109 p1rev: 3
1109 1110 p1rev: 2
1110 1111 p1rev: 1
1111 1112 p1rev: 0
1112 1113 p1rev: -1
1113 1114 p1rev--verbose: 7
1114 1115 p1rev--verbose: -1
1115 1116 p1rev--verbose: 5
1116 1117 p1rev--verbose: 3
1117 1118 p1rev--verbose: 3
1118 1119 p1rev--verbose: 2
1119 1120 p1rev--verbose: 1
1120 1121 p1rev--verbose: 0
1121 1122 p1rev--verbose: -1
1122 1123 p1rev--debug: 7
1123 1124 p1rev--debug: -1
1124 1125 p1rev--debug: 5
1125 1126 p1rev--debug: 3
1126 1127 p1rev--debug: 3
1127 1128 p1rev--debug: 2
1128 1129 p1rev--debug: 1
1129 1130 p1rev--debug: 0
1130 1131 p1rev--debug: -1
1131 1132 p2rev: -1
1132 1133 p2rev: -1
1133 1134 p2rev: 4
1134 1135 p2rev: -1
1135 1136 p2rev: -1
1136 1137 p2rev: -1
1137 1138 p2rev: -1
1138 1139 p2rev: -1
1139 1140 p2rev: -1
1140 1141 p2rev--verbose: -1
1141 1142 p2rev--verbose: -1
1142 1143 p2rev--verbose: 4
1143 1144 p2rev--verbose: -1
1144 1145 p2rev--verbose: -1
1145 1146 p2rev--verbose: -1
1146 1147 p2rev--verbose: -1
1147 1148 p2rev--verbose: -1
1148 1149 p2rev--verbose: -1
1149 1150 p2rev--debug: -1
1150 1151 p2rev--debug: -1
1151 1152 p2rev--debug: 4
1152 1153 p2rev--debug: -1
1153 1154 p2rev--debug: -1
1154 1155 p2rev--debug: -1
1155 1156 p2rev--debug: -1
1156 1157 p2rev--debug: -1
1157 1158 p2rev--debug: -1
1158 1159 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1159 1160 p1node: 0000000000000000000000000000000000000000
1160 1161 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f
1161 1162 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1162 1163 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1163 1164 p1node: 97054abb4ab824450e9164180baf491ae0078465
1164 1165 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1165 1166 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f
1166 1167 p1node: 0000000000000000000000000000000000000000
1167 1168 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1168 1169 p1node--verbose: 0000000000000000000000000000000000000000
1169 1170 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
1170 1171 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1171 1172 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1172 1173 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465
1173 1174 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1174 1175 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
1175 1176 p1node--verbose: 0000000000000000000000000000000000000000
1176 1177 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
1177 1178 p1node--debug: 0000000000000000000000000000000000000000
1178 1179 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
1179 1180 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1180 1181 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
1181 1182 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465
1182 1183 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1183 1184 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
1184 1185 p1node--debug: 0000000000000000000000000000000000000000
1185 1186 p2node: 0000000000000000000000000000000000000000
1186 1187 p2node: 0000000000000000000000000000000000000000
1187 1188 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1188 1189 p2node: 0000000000000000000000000000000000000000
1189 1190 p2node: 0000000000000000000000000000000000000000
1190 1191 p2node: 0000000000000000000000000000000000000000
1191 1192 p2node: 0000000000000000000000000000000000000000
1192 1193 p2node: 0000000000000000000000000000000000000000
1193 1194 p2node: 0000000000000000000000000000000000000000
1194 1195 p2node--verbose: 0000000000000000000000000000000000000000
1195 1196 p2node--verbose: 0000000000000000000000000000000000000000
1196 1197 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1197 1198 p2node--verbose: 0000000000000000000000000000000000000000
1198 1199 p2node--verbose: 0000000000000000000000000000000000000000
1199 1200 p2node--verbose: 0000000000000000000000000000000000000000
1200 1201 p2node--verbose: 0000000000000000000000000000000000000000
1201 1202 p2node--verbose: 0000000000000000000000000000000000000000
1202 1203 p2node--verbose: 0000000000000000000000000000000000000000
1203 1204 p2node--debug: 0000000000000000000000000000000000000000
1204 1205 p2node--debug: 0000000000000000000000000000000000000000
1205 1206 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
1206 1207 p2node--debug: 0000000000000000000000000000000000000000
1207 1208 p2node--debug: 0000000000000000000000000000000000000000
1208 1209 p2node--debug: 0000000000000000000000000000000000000000
1209 1210 p2node--debug: 0000000000000000000000000000000000000000
1210 1211 p2node--debug: 0000000000000000000000000000000000000000
1211 1212 p2node--debug: 0000000000000000000000000000000000000000
1212 1213
1213 1214 Filters work:
1214 1215
1215 1216 $ hg log --template '{author|domain}\n'
1216 1217
1217 1218 hostname
1218 1219
1219 1220
1220 1221
1221 1222
1222 1223 place
1223 1224 place
1224 1225 hostname
1225 1226
1226 1227 $ hg log --template '{author|person}\n'
1227 1228 test
1228 1229 User Name
1229 1230 person
1230 1231 person
1231 1232 person
1232 1233 person
1233 1234 other
1234 1235 A. N. Other
1235 1236 User Name
1236 1237
1237 1238 $ hg log --template '{author|user}\n'
1238 1239 test
1239 1240 user
1240 1241 person
1241 1242 person
1242 1243 person
1243 1244 person
1244 1245 other
1245 1246 other
1246 1247 user
1247 1248
1248 1249 $ hg log --template '{date|date}\n'
1249 1250 Wed Jan 01 10:01:00 2020 +0000
1250 1251 Mon Jan 12 13:46:40 1970 +0000
1251 1252 Sun Jan 18 08:40:01 1970 +0000
1252 1253 Sun Jan 18 08:40:00 1970 +0000
1253 1254 Sat Jan 17 04:53:20 1970 +0000
1254 1255 Fri Jan 16 01:06:40 1970 +0000
1255 1256 Wed Jan 14 21:20:00 1970 +0000
1256 1257 Tue Jan 13 17:33:20 1970 +0000
1257 1258 Mon Jan 12 13:46:40 1970 +0000
1258 1259
1259 1260 $ hg log --template '{date|isodate}\n'
1260 1261 2020-01-01 10:01 +0000
1261 1262 1970-01-12 13:46 +0000
1262 1263 1970-01-18 08:40 +0000
1263 1264 1970-01-18 08:40 +0000
1264 1265 1970-01-17 04:53 +0000
1265 1266 1970-01-16 01:06 +0000
1266 1267 1970-01-14 21:20 +0000
1267 1268 1970-01-13 17:33 +0000
1268 1269 1970-01-12 13:46 +0000
1269 1270
1270 1271 $ hg log --template '{date|isodatesec}\n'
1271 1272 2020-01-01 10:01:00 +0000
1272 1273 1970-01-12 13:46:40 +0000
1273 1274 1970-01-18 08:40:01 +0000
1274 1275 1970-01-18 08:40:00 +0000
1275 1276 1970-01-17 04:53:20 +0000
1276 1277 1970-01-16 01:06:40 +0000
1277 1278 1970-01-14 21:20:00 +0000
1278 1279 1970-01-13 17:33:20 +0000
1279 1280 1970-01-12 13:46:40 +0000
1280 1281
1281 1282 $ hg log --template '{date|rfc822date}\n'
1282 1283 Wed, 01 Jan 2020 10:01:00 +0000
1283 1284 Mon, 12 Jan 1970 13:46:40 +0000
1284 1285 Sun, 18 Jan 1970 08:40:01 +0000
1285 1286 Sun, 18 Jan 1970 08:40:00 +0000
1286 1287 Sat, 17 Jan 1970 04:53:20 +0000
1287 1288 Fri, 16 Jan 1970 01:06:40 +0000
1288 1289 Wed, 14 Jan 1970 21:20:00 +0000
1289 1290 Tue, 13 Jan 1970 17:33:20 +0000
1290 1291 Mon, 12 Jan 1970 13:46:40 +0000
1291 1292
1292 1293 $ hg log --template '{desc|firstline}\n'
1293 1294 third
1294 1295 second
1295 1296 merge
1296 1297 new head
1297 1298 new branch
1298 1299 no user, no domain
1299 1300 no person
1300 1301 other 1
1301 1302 line 1
1302 1303
1303 1304 $ hg log --template '{node|short}\n'
1304 1305 95c24699272e
1305 1306 29114dbae42b
1306 1307 d41e714fe50d
1307 1308 13207e5a10d9
1308 1309 bbe44766e73d
1309 1310 10e46f2dcbf4
1310 1311 97054abb4ab8
1311 1312 b608e9d1a3f0
1312 1313 1e4e1b8f71e0
1313 1314
1314 1315 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1315 1316 <changeset author="test"/>
1316 1317 <changeset author="User Name &lt;user@hostname&gt;"/>
1317 1318 <changeset author="person"/>
1318 1319 <changeset author="person"/>
1319 1320 <changeset author="person"/>
1320 1321 <changeset author="person"/>
1321 1322 <changeset author="other@place"/>
1322 1323 <changeset author="A. N. Other &lt;other@place&gt;"/>
1323 1324 <changeset author="User Name &lt;user@hostname&gt;"/>
1324 1325
1325 1326 $ hg log --template '{rev}: {children}\n'
1326 1327 8:
1327 1328 7: 8:95c24699272e
1328 1329 6:
1329 1330 5: 6:d41e714fe50d
1330 1331 4: 6:d41e714fe50d
1331 1332 3: 4:bbe44766e73d 5:13207e5a10d9
1332 1333 2: 3:10e46f2dcbf4
1333 1334 1: 2:97054abb4ab8
1334 1335 0: 1:b608e9d1a3f0
1335 1336
1336 1337 Formatnode filter works:
1337 1338
1338 1339 $ hg -q log -r 0 --template '{node|formatnode}\n'
1339 1340 1e4e1b8f71e0
1340 1341
1341 1342 $ hg log -r 0 --template '{node|formatnode}\n'
1342 1343 1e4e1b8f71e0
1343 1344
1344 1345 $ hg -v log -r 0 --template '{node|formatnode}\n'
1345 1346 1e4e1b8f71e0
1346 1347
1347 1348 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1348 1349 1e4e1b8f71e05681d422154f5421e385fec3454f
1349 1350
1350 1351 Age filter:
1351 1352
1352 1353 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1353 1354
1354 1355 >>> from datetime import datetime, timedelta
1355 1356 >>> fp = open('a', 'w')
1356 1357 >>> n = datetime.now() + timedelta(366 * 7)
1357 1358 >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
1358 1359 >>> fp.close()
1359 1360 $ hg add a
1360 1361 $ hg commit -m future -d "`cat a`"
1361 1362
1362 1363 $ hg log -l1 --template '{date|age}\n'
1363 1364 7 years from now
1364 1365
1365 1366 Error on syntax:
1366 1367
1367 1368 $ echo 'x = "f' >> t
1368 1369 $ hg log
1369 1370 abort: t:3: unmatched quotes
1370 1371 [255]
1371 1372
1372 1373 Behind the scenes, this will throw TypeError
1373 1374
1374 1375 $ hg log -l 3 --template '{date|obfuscate}\n'
1375 1376 abort: template filter 'obfuscate' is not compatible with keyword 'date'
1376 1377 [255]
1377 1378
1378 1379 Behind the scenes, this will throw a ValueError
1379 1380
1380 1381 $ hg log -l 3 --template 'line: {desc|shortdate}\n'
1381 1382 abort: template filter 'shortdate' is not compatible with keyword 'desc'
1382 1383 [255]
1383 1384
1384 1385 Behind the scenes, this will throw AttributeError
1385 1386
1386 1387 $ hg log -l 3 --template 'line: {date|escape}\n'
1387 1388 abort: template filter 'escape' is not compatible with keyword 'date'
1388 1389 [255]
1389 1390
1390 1391 Behind the scenes, this will throw ValueError
1391 1392
1392 1393 $ hg tip --template '{author|email|date}\n'
1393 1394 abort: template filter 'datefilter' is not compatible with keyword 'author'
1394 1395 [255]
1395 1396
1396 1397 $ cd ..
1397 1398
1398 1399
1399 1400 latesttag:
1400 1401
1401 1402 $ hg init latesttag
1402 1403 $ cd latesttag
1403 1404
1404 1405 $ echo a > file
1405 1406 $ hg ci -Am a -d '0 0'
1406 1407 adding file
1407 1408
1408 1409 $ echo b >> file
1409 1410 $ hg ci -m b -d '1 0'
1410 1411
1411 1412 $ echo c >> head1
1412 1413 $ hg ci -Am h1c -d '2 0'
1413 1414 adding head1
1414 1415
1415 1416 $ hg update -q 1
1416 1417 $ echo d >> head2
1417 1418 $ hg ci -Am h2d -d '3 0'
1418 1419 adding head2
1419 1420 created new head
1420 1421
1421 1422 $ echo e >> head2
1422 1423 $ hg ci -m h2e -d '4 0'
1423 1424
1424 1425 $ hg merge -q
1425 1426 $ hg ci -m merge -d '5 0'
1426 1427
1427 1428 No tag set:
1428 1429
1429 1430 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1430 1431 5: null+5
1431 1432 4: null+4
1432 1433 3: null+3
1433 1434 2: null+3
1434 1435 1: null+2
1435 1436 0: null+1
1436 1437
1437 1438 One common tag: longuest path wins:
1438 1439
1439 1440 $ hg tag -r 1 -m t1 -d '6 0' t1
1440 1441 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1441 1442 6: t1+4
1442 1443 5: t1+3
1443 1444 4: t1+2
1444 1445 3: t1+1
1445 1446 2: t1+1
1446 1447 1: t1+0
1447 1448 0: null+1
1448 1449
1449 1450 One ancestor tag: more recent wins:
1450 1451
1451 1452 $ hg tag -r 2 -m t2 -d '7 0' t2
1452 1453 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1453 1454 7: t2+3
1454 1455 6: t2+2
1455 1456 5: t2+1
1456 1457 4: t1+2
1457 1458 3: t1+1
1458 1459 2: t2+0
1459 1460 1: t1+0
1460 1461 0: null+1
1461 1462
1462 1463 Two branch tags: more recent wins:
1463 1464
1464 1465 $ hg tag -r 3 -m t3 -d '8 0' t3
1465 1466 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1466 1467 8: t3+5
1467 1468 7: t3+4
1468 1469 6: t3+3
1469 1470 5: t3+2
1470 1471 4: t3+1
1471 1472 3: t3+0
1472 1473 2: t2+0
1473 1474 1: t1+0
1474 1475 0: null+1
1475 1476
1476 1477 Merged tag overrides:
1477 1478
1478 1479 $ hg tag -r 5 -m t5 -d '9 0' t5
1479 1480 $ hg tag -r 3 -m at3 -d '10 0' at3
1480 1481 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1481 1482 10: t5+5
1482 1483 9: t5+4
1483 1484 8: t5+3
1484 1485 7: t5+2
1485 1486 6: t5+1
1486 1487 5: t5+0
1487 1488 4: at3:t3+1
1488 1489 3: at3:t3+0
1489 1490 2: t2+0
1490 1491 1: t1+0
1491 1492 0: null+1
1492 1493
1493 1494 $ cd ..
1494 1495
1495 1496
1496 1497 Style path expansion: issue1948 - ui.style option doesn't work on OSX
1497 1498 if it is a relative path
1498 1499
1499 1500 $ mkdir -p home/styles
1500 1501
1501 1502 $ cat > home/styles/teststyle <<EOF
1502 1503 > changeset = 'test {rev}:{node|short}\n'
1503 1504 > EOF
1504 1505
1505 1506 $ HOME=`pwd`/home; export HOME
1506 1507
1507 1508 $ cat > latesttag/.hg/hgrc <<EOF
1508 1509 > [ui]
1509 1510 > style = ~/styles/teststyle
1510 1511 > EOF
1511 1512
1512 1513 $ hg -R latesttag tip
1513 1514 test 10:dee8f28249af
1514 1515
1515 1516 Test recursive showlist template (issue1989):
1516 1517
1517 1518 $ cat > style1989 <<EOF
1518 1519 > changeset = '{file_mods}{manifest}{extras}'
1519 1520 > file_mod = 'M|{author|person}\n'
1520 1521 > manifest = '{rev},{author}\n'
1521 1522 > extra = '{key}: {author}\n'
1522 1523 > EOF
1523 1524
1524 1525 $ hg -R latesttag log -r tip --style=style1989
1525 1526 M|test
1526 1527 10,test
1527 1528 branch: test
1528 1529
1529 1530 Test new-style inline templating:
1530 1531
1531 1532 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
1532 1533 modified files: .hgtags
1533 1534
1534 1535 Test the sub function of templating for expansion:
1535 1536
1536 1537 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
1537 1538 xx
@@ -1,1366 +1,1366 b''
1 1 Log on empty repository: checking consistency
2 2
3 3 $ hg init empty
4 4 $ cd empty
5 5 $ hg log
6 6 $ hg log -r 1
7 7 abort: unknown revision '1'!
8 8 [255]
9 9 $ hg log -r -1:0
10 10 abort: unknown revision '-1'!
11 11 [255]
12 12 $ hg log -r 'branch(name)'
13 13 abort: unknown revision 'name'!
14 14 [255]
15 15 $ hg log -r null -q
16 16 -1:000000000000
17 17
18 18 The g is crafted to have 2 filelog topological heads in a linear
19 19 changeset graph
20 20
21 21 $ hg init a
22 22 $ cd a
23 23 $ echo a > a
24 24 $ echo f > f
25 25 $ hg ci -Ama -d '1 0'
26 26 adding a
27 27 adding f
28 28
29 29 $ hg cp a b
30 30 $ hg cp f g
31 31 $ hg ci -mb -d '2 0'
32 32
33 33 $ mkdir dir
34 34 $ hg mv b dir
35 35 $ echo g >> g
36 36 $ echo f >> f
37 37 $ hg ci -mc -d '3 0'
38 38
39 39 $ hg mv a b
40 40 $ hg cp -f f g
41 41 $ echo a > d
42 42 $ hg add d
43 43 $ hg ci -md -d '4 0'
44 44
45 45 $ hg mv dir/b e
46 46 $ hg ci -me -d '5 0'
47 47
48 48 $ hg log a
49 49 changeset: 0:9161b9aeaf16
50 50 user: test
51 51 date: Thu Jan 01 00:00:01 1970 +0000
52 52 summary: a
53 53
54 54 log on directory
55 55
56 56 $ hg log dir
57 57 changeset: 4:7e4639b4691b
58 58 tag: tip
59 59 user: test
60 60 date: Thu Jan 01 00:00:05 1970 +0000
61 61 summary: e
62 62
63 63 changeset: 2:f8954cd4dc1f
64 64 user: test
65 65 date: Thu Jan 01 00:00:03 1970 +0000
66 66 summary: c
67 67
68 68 $ hg log somethingthatdoesntexist dir
69 69 changeset: 4:7e4639b4691b
70 70 tag: tip
71 71 user: test
72 72 date: Thu Jan 01 00:00:05 1970 +0000
73 73 summary: e
74 74
75 75 changeset: 2:f8954cd4dc1f
76 76 user: test
77 77 date: Thu Jan 01 00:00:03 1970 +0000
78 78 summary: c
79 79
80 80
81 81 -f, directory
82 82
83 83 $ hg log -f dir
84 84 abort: cannot follow file not in parent revision: "dir"
85 85 [255]
86 86
87 87 -f, a wrong style
88 88
89 89 $ hg log -f -l1 --style something
90 90 abort: style 'something' not found
91 (available styles: changelog, bisect, default, xml, phases, compact)
91 (available styles: bisect, changelog, compact, default, phases, xml)
92 92 [255]
93 93
94 94 -f, phases style
95 95
96 96
97 97 $ hg log -f -l1 --style phases
98 98 changeset: 4:7e4639b4691b
99 99 tag: tip
100 100 phase: draft
101 101 user: test
102 102 date: Thu Jan 01 00:00:05 1970 +0000
103 103 summary: e
104 104
105 105
106 106 -f, but no args
107 107
108 108 $ hg log -f
109 109 changeset: 4:7e4639b4691b
110 110 tag: tip
111 111 user: test
112 112 date: Thu Jan 01 00:00:05 1970 +0000
113 113 summary: e
114 114
115 115 changeset: 3:2ca5ba701980
116 116 user: test
117 117 date: Thu Jan 01 00:00:04 1970 +0000
118 118 summary: d
119 119
120 120 changeset: 2:f8954cd4dc1f
121 121 user: test
122 122 date: Thu Jan 01 00:00:03 1970 +0000
123 123 summary: c
124 124
125 125 changeset: 1:d89b0a12d229
126 126 user: test
127 127 date: Thu Jan 01 00:00:02 1970 +0000
128 128 summary: b
129 129
130 130 changeset: 0:9161b9aeaf16
131 131 user: test
132 132 date: Thu Jan 01 00:00:01 1970 +0000
133 133 summary: a
134 134
135 135
136 136 one rename
137 137
138 138 $ hg up -q 2
139 139 $ hg log -vf a
140 140 changeset: 0:9161b9aeaf16
141 141 user: test
142 142 date: Thu Jan 01 00:00:01 1970 +0000
143 143 files: a f
144 144 description:
145 145 a
146 146
147 147
148 148
149 149 many renames
150 150
151 151 $ hg up -q tip
152 152 $ hg log -vf e
153 153 changeset: 4:7e4639b4691b
154 154 tag: tip
155 155 user: test
156 156 date: Thu Jan 01 00:00:05 1970 +0000
157 157 files: dir/b e
158 158 description:
159 159 e
160 160
161 161
162 162 changeset: 2:f8954cd4dc1f
163 163 user: test
164 164 date: Thu Jan 01 00:00:03 1970 +0000
165 165 files: b dir/b f g
166 166 description:
167 167 c
168 168
169 169
170 170 changeset: 1:d89b0a12d229
171 171 user: test
172 172 date: Thu Jan 01 00:00:02 1970 +0000
173 173 files: b g
174 174 description:
175 175 b
176 176
177 177
178 178 changeset: 0:9161b9aeaf16
179 179 user: test
180 180 date: Thu Jan 01 00:00:01 1970 +0000
181 181 files: a f
182 182 description:
183 183 a
184 184
185 185
186 186
187 187
188 188 log -pf dir/b
189 189
190 190 $ hg up -q 3
191 191 $ hg log -pf dir/b
192 192 changeset: 2:f8954cd4dc1f
193 193 user: test
194 194 date: Thu Jan 01 00:00:03 1970 +0000
195 195 summary: c
196 196
197 197 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
198 198 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
199 199 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
200 200 @@ -0,0 +1,1 @@
201 201 +a
202 202
203 203 changeset: 1:d89b0a12d229
204 204 user: test
205 205 date: Thu Jan 01 00:00:02 1970 +0000
206 206 summary: b
207 207
208 208 diff -r 9161b9aeaf16 -r d89b0a12d229 b
209 209 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
210 210 +++ b/b Thu Jan 01 00:00:02 1970 +0000
211 211 @@ -0,0 +1,1 @@
212 212 +a
213 213
214 214 changeset: 0:9161b9aeaf16
215 215 user: test
216 216 date: Thu Jan 01 00:00:01 1970 +0000
217 217 summary: a
218 218
219 219 diff -r 000000000000 -r 9161b9aeaf16 a
220 220 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
221 221 +++ b/a Thu Jan 01 00:00:01 1970 +0000
222 222 @@ -0,0 +1,1 @@
223 223 +a
224 224
225 225
226 226 log -vf dir/b
227 227
228 228 $ hg log -vf dir/b
229 229 changeset: 2:f8954cd4dc1f
230 230 user: test
231 231 date: Thu Jan 01 00:00:03 1970 +0000
232 232 files: b dir/b f g
233 233 description:
234 234 c
235 235
236 236
237 237 changeset: 1:d89b0a12d229
238 238 user: test
239 239 date: Thu Jan 01 00:00:02 1970 +0000
240 240 files: b g
241 241 description:
242 242 b
243 243
244 244
245 245 changeset: 0:9161b9aeaf16
246 246 user: test
247 247 date: Thu Jan 01 00:00:01 1970 +0000
248 248 files: a f
249 249 description:
250 250 a
251 251
252 252
253 253
254 254
255 255 -f and multiple filelog heads
256 256
257 257 $ hg up -q 2
258 258 $ hg log -f g --template '{rev}\n'
259 259 2
260 260 1
261 261 0
262 262 $ hg up -q tip
263 263 $ hg log -f g --template '{rev}\n'
264 264 3
265 265 2
266 266 0
267 267
268 268
269 269 log copies with --copies
270 270
271 271 $ hg log -vC --template '{rev} {file_copies}\n'
272 272 4 e (dir/b)
273 273 3 b (a)g (f)
274 274 2 dir/b (b)
275 275 1 b (a)g (f)
276 276 0
277 277
278 278 log copies switch without --copies, with old filecopy template
279 279
280 280 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
281 281 4
282 282 3
283 283 2
284 284 1
285 285 0
286 286
287 287 log copies switch with --copies
288 288
289 289 $ hg log -vC --template '{rev} {file_copies_switch}\n'
290 290 4 e (dir/b)
291 291 3 b (a)g (f)
292 292 2 dir/b (b)
293 293 1 b (a)g (f)
294 294 0
295 295
296 296
297 297 log copies with hardcoded style and with --style=default
298 298
299 299 $ hg log -vC -r4
300 300 changeset: 4:7e4639b4691b
301 301 tag: tip
302 302 user: test
303 303 date: Thu Jan 01 00:00:05 1970 +0000
304 304 files: dir/b e
305 305 copies: e (dir/b)
306 306 description:
307 307 e
308 308
309 309
310 310 $ hg log -vC -r4 --style=default
311 311 changeset: 4:7e4639b4691b
312 312 tag: tip
313 313 user: test
314 314 date: Thu Jan 01 00:00:05 1970 +0000
315 315 files: dir/b e
316 316 copies: e (dir/b)
317 317 description:
318 318 e
319 319
320 320
321 321
322 322
323 323 log copies, non-linear manifest
324 324
325 325 $ hg up -C 3
326 326 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
327 327 $ hg mv dir/b e
328 328 $ echo foo > foo
329 329 $ hg ci -Ame2 -d '6 0'
330 330 adding foo
331 331 created new head
332 332 $ hg log -v --template '{rev} {file_copies}\n' -r 5
333 333 5 e (dir/b)
334 334
335 335
336 336 log copies, execute bit set
337 337
338 338 #if execbit
339 339 $ chmod +x e
340 340 $ hg ci -me3 -d '7 0'
341 341 $ hg log -v --template '{rev} {file_copies}\n' -r 6
342 342 6
343 343 #endif
344 344
345 345
346 346 log -p d
347 347
348 348 $ hg log -pv d
349 349 changeset: 3:2ca5ba701980
350 350 user: test
351 351 date: Thu Jan 01 00:00:04 1970 +0000
352 352 files: a b d g
353 353 description:
354 354 d
355 355
356 356
357 357 diff -r f8954cd4dc1f -r 2ca5ba701980 d
358 358 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
359 359 +++ b/d Thu Jan 01 00:00:04 1970 +0000
360 360 @@ -0,0 +1,1 @@
361 361 +a
362 362
363 363
364 364
365 365 log --removed file
366 366
367 367 $ hg log --removed -v a
368 368 changeset: 3:2ca5ba701980
369 369 user: test
370 370 date: Thu Jan 01 00:00:04 1970 +0000
371 371 files: a b d g
372 372 description:
373 373 d
374 374
375 375
376 376 changeset: 0:9161b9aeaf16
377 377 user: test
378 378 date: Thu Jan 01 00:00:01 1970 +0000
379 379 files: a f
380 380 description:
381 381 a
382 382
383 383
384 384
385 385 log --removed revrange file
386 386
387 387 $ hg log --removed -v -r0:2 a
388 388 changeset: 0:9161b9aeaf16
389 389 user: test
390 390 date: Thu Jan 01 00:00:01 1970 +0000
391 391 files: a f
392 392 description:
393 393 a
394 394
395 395
396 396 $ cd ..
397 397
398 398 log --follow tests
399 399
400 400 $ hg init follow
401 401 $ cd follow
402 402
403 403 $ echo base > base
404 404 $ hg ci -Ambase -d '1 0'
405 405 adding base
406 406
407 407 $ echo r1 >> base
408 408 $ hg ci -Amr1 -d '1 0'
409 409 $ echo r2 >> base
410 410 $ hg ci -Amr2 -d '1 0'
411 411
412 412 $ hg up -C 1
413 413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 414 $ echo b1 > b1
415 415 $ hg ci -Amb1 -d '1 0'
416 416 adding b1
417 417 created new head
418 418
419 419
420 420 log -f
421 421
422 422 $ hg log -f
423 423 changeset: 3:e62f78d544b4
424 424 tag: tip
425 425 parent: 1:3d5bf5654eda
426 426 user: test
427 427 date: Thu Jan 01 00:00:01 1970 +0000
428 428 summary: b1
429 429
430 430 changeset: 1:3d5bf5654eda
431 431 user: test
432 432 date: Thu Jan 01 00:00:01 1970 +0000
433 433 summary: r1
434 434
435 435 changeset: 0:67e992f2c4f3
436 436 user: test
437 437 date: Thu Jan 01 00:00:01 1970 +0000
438 438 summary: base
439 439
440 440
441 441
442 442 log -f -r 1:tip
443 443
444 444 $ hg up -C 0
445 445 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
446 446 $ echo b2 > b2
447 447 $ hg ci -Amb2 -d '1 0'
448 448 adding b2
449 449 created new head
450 450 $ hg log -f -r 1:tip
451 451 changeset: 1:3d5bf5654eda
452 452 user: test
453 453 date: Thu Jan 01 00:00:01 1970 +0000
454 454 summary: r1
455 455
456 456 changeset: 2:60c670bf5b30
457 457 user: test
458 458 date: Thu Jan 01 00:00:01 1970 +0000
459 459 summary: r2
460 460
461 461 changeset: 3:e62f78d544b4
462 462 parent: 1:3d5bf5654eda
463 463 user: test
464 464 date: Thu Jan 01 00:00:01 1970 +0000
465 465 summary: b1
466 466
467 467
468 468
469 469 log -r . with two parents
470 470
471 471 $ hg up -C 3
472 472 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
473 473 $ hg merge tip
474 474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 475 (branch merge, don't forget to commit)
476 476 $ hg log -r .
477 477 changeset: 3:e62f78d544b4
478 478 parent: 1:3d5bf5654eda
479 479 user: test
480 480 date: Thu Jan 01 00:00:01 1970 +0000
481 481 summary: b1
482 482
483 483
484 484
485 485 log -r . with one parent
486 486
487 487 $ hg ci -mm12 -d '1 0'
488 488 $ hg log -r .
489 489 changeset: 5:302e9dd6890d
490 490 tag: tip
491 491 parent: 3:e62f78d544b4
492 492 parent: 4:ddb82e70d1a1
493 493 user: test
494 494 date: Thu Jan 01 00:00:01 1970 +0000
495 495 summary: m12
496 496
497 497
498 498 $ echo postm >> b1
499 499 $ hg ci -Amb1.1 -d'1 0'
500 500
501 501
502 502 log --follow-first
503 503
504 504 $ hg log --follow-first
505 505 changeset: 6:2404bbcab562
506 506 tag: tip
507 507 user: test
508 508 date: Thu Jan 01 00:00:01 1970 +0000
509 509 summary: b1.1
510 510
511 511 changeset: 5:302e9dd6890d
512 512 parent: 3:e62f78d544b4
513 513 parent: 4:ddb82e70d1a1
514 514 user: test
515 515 date: Thu Jan 01 00:00:01 1970 +0000
516 516 summary: m12
517 517
518 518 changeset: 3:e62f78d544b4
519 519 parent: 1:3d5bf5654eda
520 520 user: test
521 521 date: Thu Jan 01 00:00:01 1970 +0000
522 522 summary: b1
523 523
524 524 changeset: 1:3d5bf5654eda
525 525 user: test
526 526 date: Thu Jan 01 00:00:01 1970 +0000
527 527 summary: r1
528 528
529 529 changeset: 0:67e992f2c4f3
530 530 user: test
531 531 date: Thu Jan 01 00:00:01 1970 +0000
532 532 summary: base
533 533
534 534
535 535
536 536 log -P 2
537 537
538 538 $ hg log -P 2
539 539 changeset: 6:2404bbcab562
540 540 tag: tip
541 541 user: test
542 542 date: Thu Jan 01 00:00:01 1970 +0000
543 543 summary: b1.1
544 544
545 545 changeset: 5:302e9dd6890d
546 546 parent: 3:e62f78d544b4
547 547 parent: 4:ddb82e70d1a1
548 548 user: test
549 549 date: Thu Jan 01 00:00:01 1970 +0000
550 550 summary: m12
551 551
552 552 changeset: 4:ddb82e70d1a1
553 553 parent: 0:67e992f2c4f3
554 554 user: test
555 555 date: Thu Jan 01 00:00:01 1970 +0000
556 556 summary: b2
557 557
558 558 changeset: 3:e62f78d544b4
559 559 parent: 1:3d5bf5654eda
560 560 user: test
561 561 date: Thu Jan 01 00:00:01 1970 +0000
562 562 summary: b1
563 563
564 564
565 565
566 566 log -r tip -p --git
567 567
568 568 $ hg log -r tip -p --git
569 569 changeset: 6:2404bbcab562
570 570 tag: tip
571 571 user: test
572 572 date: Thu Jan 01 00:00:01 1970 +0000
573 573 summary: b1.1
574 574
575 575 diff --git a/b1 b/b1
576 576 --- a/b1
577 577 +++ b/b1
578 578 @@ -1,1 +1,2 @@
579 579 b1
580 580 +postm
581 581
582 582
583 583
584 584 log -r ""
585 585
586 586 $ hg log -r ''
587 587 hg: parse error: empty query
588 588 [255]
589 589
590 590 log -r <some unknown node id>
591 591
592 592 $ hg log -r 1000000000000000000000000000000000000000
593 593 abort: unknown revision '1000000000000000000000000000000000000000'!
594 594 [255]
595 595
596 596 log -k r1
597 597
598 598 $ hg log -k r1
599 599 changeset: 1:3d5bf5654eda
600 600 user: test
601 601 date: Thu Jan 01 00:00:01 1970 +0000
602 602 summary: r1
603 603
604 604 log -p -l2 --color=always
605 605
606 606 $ hg --config extensions.color= --config color.mode=ansi \
607 607 > log -p -l2 --color=always
608 608 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
609 609 tag: tip
610 610 user: test
611 611 date: Thu Jan 01 00:00:01 1970 +0000
612 612 summary: b1.1
613 613
614 614 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
615 615 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
616 616 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
617 617 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
618 618 b1
619 619 \x1b[0;32m+postm\x1b[0m (esc)
620 620
621 621 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
622 622 parent: 3:e62f78d544b4
623 623 parent: 4:ddb82e70d1a1
624 624 user: test
625 625 date: Thu Jan 01 00:00:01 1970 +0000
626 626 summary: m12
627 627
628 628 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
629 629 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
630 630 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
631 631 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
632 632 \x1b[0;32m+b2\x1b[0m (esc)
633 633
634 634
635 635
636 636 log -r tip --stat
637 637
638 638 $ hg log -r tip --stat
639 639 changeset: 6:2404bbcab562
640 640 tag: tip
641 641 user: test
642 642 date: Thu Jan 01 00:00:01 1970 +0000
643 643 summary: b1.1
644 644
645 645 b1 | 1 +
646 646 1 files changed, 1 insertions(+), 0 deletions(-)
647 647
648 648
649 649 $ cd ..
650 650
651 651
652 652 User
653 653
654 654 $ hg init usertest
655 655 $ cd usertest
656 656
657 657 $ echo a > a
658 658 $ hg ci -A -m "a" -u "User One <user1@example.org>"
659 659 adding a
660 660 $ echo b > b
661 661 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
662 662 adding b
663 663
664 664 $ hg log -u "User One <user1@example.org>"
665 665 changeset: 0:29a4c94f1924
666 666 user: User One <user1@example.org>
667 667 date: Thu Jan 01 00:00:00 1970 +0000
668 668 summary: a
669 669
670 670 $ hg log -u "user1" -u "user2"
671 671 changeset: 1:e834b5e69c0e
672 672 tag: tip
673 673 user: User Two <user2@example.org>
674 674 date: Thu Jan 01 00:00:00 1970 +0000
675 675 summary: b
676 676
677 677 changeset: 0:29a4c94f1924
678 678 user: User One <user1@example.org>
679 679 date: Thu Jan 01 00:00:00 1970 +0000
680 680 summary: a
681 681
682 682 $ hg log -u "user3"
683 683
684 684 $ cd ..
685 685
686 686 $ hg init branches
687 687 $ cd branches
688 688
689 689 $ echo a > a
690 690 $ hg ci -A -m "commit on default"
691 691 adding a
692 692 $ hg branch test
693 693 marked working directory as branch test
694 694 (branches are permanent and global, did you want a bookmark?)
695 695 $ echo b > b
696 696 $ hg ci -A -m "commit on test"
697 697 adding b
698 698
699 699 $ hg up default
700 700 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
701 701 $ echo c > c
702 702 $ hg ci -A -m "commit on default"
703 703 adding c
704 704 $ hg up test
705 705 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
706 706 $ echo c > c
707 707 $ hg ci -A -m "commit on test"
708 708 adding c
709 709
710 710
711 711 log -b default
712 712
713 713 $ hg log -b default
714 714 changeset: 2:c3a4f03cc9a7
715 715 parent: 0:24427303d56f
716 716 user: test
717 717 date: Thu Jan 01 00:00:00 1970 +0000
718 718 summary: commit on default
719 719
720 720 changeset: 0:24427303d56f
721 721 user: test
722 722 date: Thu Jan 01 00:00:00 1970 +0000
723 723 summary: commit on default
724 724
725 725
726 726
727 727 log -b test
728 728
729 729 $ hg log -b test
730 730 changeset: 3:f5d8de11c2e2
731 731 branch: test
732 732 tag: tip
733 733 parent: 1:d32277701ccb
734 734 user: test
735 735 date: Thu Jan 01 00:00:00 1970 +0000
736 736 summary: commit on test
737 737
738 738 changeset: 1:d32277701ccb
739 739 branch: test
740 740 user: test
741 741 date: Thu Jan 01 00:00:00 1970 +0000
742 742 summary: commit on test
743 743
744 744
745 745
746 746 log -b dummy
747 747
748 748 $ hg log -b dummy
749 749 abort: unknown revision 'dummy'!
750 750 [255]
751 751
752 752
753 753 log -b .
754 754
755 755 $ hg log -b .
756 756 changeset: 3:f5d8de11c2e2
757 757 branch: test
758 758 tag: tip
759 759 parent: 1:d32277701ccb
760 760 user: test
761 761 date: Thu Jan 01 00:00:00 1970 +0000
762 762 summary: commit on test
763 763
764 764 changeset: 1:d32277701ccb
765 765 branch: test
766 766 user: test
767 767 date: Thu Jan 01 00:00:00 1970 +0000
768 768 summary: commit on test
769 769
770 770
771 771
772 772 log -b default -b test
773 773
774 774 $ hg log -b default -b test
775 775 changeset: 3:f5d8de11c2e2
776 776 branch: test
777 777 tag: tip
778 778 parent: 1:d32277701ccb
779 779 user: test
780 780 date: Thu Jan 01 00:00:00 1970 +0000
781 781 summary: commit on test
782 782
783 783 changeset: 2:c3a4f03cc9a7
784 784 parent: 0:24427303d56f
785 785 user: test
786 786 date: Thu Jan 01 00:00:00 1970 +0000
787 787 summary: commit on default
788 788
789 789 changeset: 1:d32277701ccb
790 790 branch: test
791 791 user: test
792 792 date: Thu Jan 01 00:00:00 1970 +0000
793 793 summary: commit on test
794 794
795 795 changeset: 0:24427303d56f
796 796 user: test
797 797 date: Thu Jan 01 00:00:00 1970 +0000
798 798 summary: commit on default
799 799
800 800
801 801
802 802 log -b default -b .
803 803
804 804 $ hg log -b default -b .
805 805 changeset: 3:f5d8de11c2e2
806 806 branch: test
807 807 tag: tip
808 808 parent: 1:d32277701ccb
809 809 user: test
810 810 date: Thu Jan 01 00:00:00 1970 +0000
811 811 summary: commit on test
812 812
813 813 changeset: 2:c3a4f03cc9a7
814 814 parent: 0:24427303d56f
815 815 user: test
816 816 date: Thu Jan 01 00:00:00 1970 +0000
817 817 summary: commit on default
818 818
819 819 changeset: 1:d32277701ccb
820 820 branch: test
821 821 user: test
822 822 date: Thu Jan 01 00:00:00 1970 +0000
823 823 summary: commit on test
824 824
825 825 changeset: 0:24427303d56f
826 826 user: test
827 827 date: Thu Jan 01 00:00:00 1970 +0000
828 828 summary: commit on default
829 829
830 830
831 831
832 832 log -b . -b test
833 833
834 834 $ hg log -b . -b test
835 835 changeset: 3:f5d8de11c2e2
836 836 branch: test
837 837 tag: tip
838 838 parent: 1:d32277701ccb
839 839 user: test
840 840 date: Thu Jan 01 00:00:00 1970 +0000
841 841 summary: commit on test
842 842
843 843 changeset: 1:d32277701ccb
844 844 branch: test
845 845 user: test
846 846 date: Thu Jan 01 00:00:00 1970 +0000
847 847 summary: commit on test
848 848
849 849
850 850
851 851 log -b 2
852 852
853 853 $ hg log -b 2
854 854 changeset: 2:c3a4f03cc9a7
855 855 parent: 0:24427303d56f
856 856 user: test
857 857 date: Thu Jan 01 00:00:00 1970 +0000
858 858 summary: commit on default
859 859
860 860 changeset: 0:24427303d56f
861 861 user: test
862 862 date: Thu Jan 01 00:00:00 1970 +0000
863 863 summary: commit on default
864 864
865 865
866 866
867 867 log -p --cwd dir (in subdir)
868 868
869 869 $ mkdir dir
870 870 $ hg log -p --cwd dir
871 871 changeset: 3:f5d8de11c2e2
872 872 branch: test
873 873 tag: tip
874 874 parent: 1:d32277701ccb
875 875 user: test
876 876 date: Thu Jan 01 00:00:00 1970 +0000
877 877 summary: commit on test
878 878
879 879 diff -r d32277701ccb -r f5d8de11c2e2 c
880 880 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
881 881 +++ b/c Thu Jan 01 00:00:00 1970 +0000
882 882 @@ -0,0 +1,1 @@
883 883 +c
884 884
885 885 changeset: 2:c3a4f03cc9a7
886 886 parent: 0:24427303d56f
887 887 user: test
888 888 date: Thu Jan 01 00:00:00 1970 +0000
889 889 summary: commit on default
890 890
891 891 diff -r 24427303d56f -r c3a4f03cc9a7 c
892 892 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
893 893 +++ b/c Thu Jan 01 00:00:00 1970 +0000
894 894 @@ -0,0 +1,1 @@
895 895 +c
896 896
897 897 changeset: 1:d32277701ccb
898 898 branch: test
899 899 user: test
900 900 date: Thu Jan 01 00:00:00 1970 +0000
901 901 summary: commit on test
902 902
903 903 diff -r 24427303d56f -r d32277701ccb b
904 904 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
905 905 +++ b/b Thu Jan 01 00:00:00 1970 +0000
906 906 @@ -0,0 +1,1 @@
907 907 +b
908 908
909 909 changeset: 0:24427303d56f
910 910 user: test
911 911 date: Thu Jan 01 00:00:00 1970 +0000
912 912 summary: commit on default
913 913
914 914 diff -r 000000000000 -r 24427303d56f a
915 915 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
916 916 +++ b/a Thu Jan 01 00:00:00 1970 +0000
917 917 @@ -0,0 +1,1 @@
918 918 +a
919 919
920 920
921 921
922 922 log -p -R repo
923 923
924 924 $ cd dir
925 925 $ hg log -p -R .. ../a
926 926 changeset: 0:24427303d56f
927 927 user: test
928 928 date: Thu Jan 01 00:00:00 1970 +0000
929 929 summary: commit on default
930 930
931 931 diff -r 000000000000 -r 24427303d56f a
932 932 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
933 933 +++ b/a Thu Jan 01 00:00:00 1970 +0000
934 934 @@ -0,0 +1,1 @@
935 935 +a
936 936
937 937
938 938 $ cd ../..
939 939
940 940 $ hg init follow2
941 941 $ cd follow2
942 942
943 943 # Build the following history:
944 944 # tip - o - x - o - x - x
945 945 # \ /
946 946 # o - o - o - x
947 947 # \ /
948 948 # o
949 949 #
950 950 # Where "o" is a revision containing "foo" and
951 951 # "x" is a revision without "foo"
952 952
953 953 $ touch init
954 954 $ hg ci -A -m "init, unrelated"
955 955 adding init
956 956 $ echo 'foo' > init
957 957 $ hg ci -m "change, unrelated"
958 958 $ echo 'foo' > foo
959 959 $ hg ci -A -m "add unrelated old foo"
960 960 adding foo
961 961 $ hg rm foo
962 962 $ hg ci -m "delete foo, unrelated"
963 963 $ echo 'related' > foo
964 964 $ hg ci -A -m "add foo, related"
965 965 adding foo
966 966
967 967 $ hg up 0
968 968 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
969 969 $ touch branch
970 970 $ hg ci -A -m "first branch, unrelated"
971 971 adding branch
972 972 created new head
973 973 $ touch foo
974 974 $ hg ci -A -m "create foo, related"
975 975 adding foo
976 976 $ echo 'change' > foo
977 977 $ hg ci -m "change foo, related"
978 978
979 979 $ hg up 6
980 980 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
981 981 $ echo 'change foo in branch' > foo
982 982 $ hg ci -m "change foo in branch, related"
983 983 created new head
984 984 $ hg merge 7
985 985 merging foo
986 986 warning: conflicts during merge.
987 987 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
988 988 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
989 989 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
990 990 [1]
991 991 $ echo 'merge 1' > foo
992 992 $ hg resolve -m foo
993 993 $ hg ci -m "First merge, related"
994 994
995 995 $ hg merge 4
996 996 merging foo
997 997 warning: conflicts during merge.
998 998 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
999 999 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1000 1000 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1001 1001 [1]
1002 1002 $ echo 'merge 2' > foo
1003 1003 $ hg resolve -m foo
1004 1004 $ hg ci -m "Last merge, related"
1005 1005
1006 1006 $ hg log --graph
1007 1007 @ changeset: 10:4dae8563d2c5
1008 1008 |\ tag: tip
1009 1009 | | parent: 9:7b35701b003e
1010 1010 | | parent: 4:88176d361b69
1011 1011 | | user: test
1012 1012 | | date: Thu Jan 01 00:00:00 1970 +0000
1013 1013 | | summary: Last merge, related
1014 1014 | |
1015 1015 | o changeset: 9:7b35701b003e
1016 1016 | |\ parent: 8:e5416ad8a855
1017 1017 | | | parent: 7:87fe3144dcfa
1018 1018 | | | user: test
1019 1019 | | | date: Thu Jan 01 00:00:00 1970 +0000
1020 1020 | | | summary: First merge, related
1021 1021 | | |
1022 1022 | | o changeset: 8:e5416ad8a855
1023 1023 | | | parent: 6:dc6c325fe5ee
1024 1024 | | | user: test
1025 1025 | | | date: Thu Jan 01 00:00:00 1970 +0000
1026 1026 | | | summary: change foo in branch, related
1027 1027 | | |
1028 1028 | o | changeset: 7:87fe3144dcfa
1029 1029 | |/ user: test
1030 1030 | | date: Thu Jan 01 00:00:00 1970 +0000
1031 1031 | | summary: change foo, related
1032 1032 | |
1033 1033 | o changeset: 6:dc6c325fe5ee
1034 1034 | | user: test
1035 1035 | | date: Thu Jan 01 00:00:00 1970 +0000
1036 1036 | | summary: create foo, related
1037 1037 | |
1038 1038 | o changeset: 5:73db34516eb9
1039 1039 | | parent: 0:e87515fd044a
1040 1040 | | user: test
1041 1041 | | date: Thu Jan 01 00:00:00 1970 +0000
1042 1042 | | summary: first branch, unrelated
1043 1043 | |
1044 1044 o | changeset: 4:88176d361b69
1045 1045 | | user: test
1046 1046 | | date: Thu Jan 01 00:00:00 1970 +0000
1047 1047 | | summary: add foo, related
1048 1048 | |
1049 1049 o | changeset: 3:dd78ae4afb56
1050 1050 | | user: test
1051 1051 | | date: Thu Jan 01 00:00:00 1970 +0000
1052 1052 | | summary: delete foo, unrelated
1053 1053 | |
1054 1054 o | changeset: 2:c4c64aedf0f7
1055 1055 | | user: test
1056 1056 | | date: Thu Jan 01 00:00:00 1970 +0000
1057 1057 | | summary: add unrelated old foo
1058 1058 | |
1059 1059 o | changeset: 1:e5faa7440653
1060 1060 |/ user: test
1061 1061 | date: Thu Jan 01 00:00:00 1970 +0000
1062 1062 | summary: change, unrelated
1063 1063 |
1064 1064 o changeset: 0:e87515fd044a
1065 1065 user: test
1066 1066 date: Thu Jan 01 00:00:00 1970 +0000
1067 1067 summary: init, unrelated
1068 1068
1069 1069
1070 1070 $ hg --traceback log -f foo
1071 1071 changeset: 10:4dae8563d2c5
1072 1072 tag: tip
1073 1073 parent: 9:7b35701b003e
1074 1074 parent: 4:88176d361b69
1075 1075 user: test
1076 1076 date: Thu Jan 01 00:00:00 1970 +0000
1077 1077 summary: Last merge, related
1078 1078
1079 1079 changeset: 9:7b35701b003e
1080 1080 parent: 8:e5416ad8a855
1081 1081 parent: 7:87fe3144dcfa
1082 1082 user: test
1083 1083 date: Thu Jan 01 00:00:00 1970 +0000
1084 1084 summary: First merge, related
1085 1085
1086 1086 changeset: 8:e5416ad8a855
1087 1087 parent: 6:dc6c325fe5ee
1088 1088 user: test
1089 1089 date: Thu Jan 01 00:00:00 1970 +0000
1090 1090 summary: change foo in branch, related
1091 1091
1092 1092 changeset: 7:87fe3144dcfa
1093 1093 user: test
1094 1094 date: Thu Jan 01 00:00:00 1970 +0000
1095 1095 summary: change foo, related
1096 1096
1097 1097 changeset: 6:dc6c325fe5ee
1098 1098 user: test
1099 1099 date: Thu Jan 01 00:00:00 1970 +0000
1100 1100 summary: create foo, related
1101 1101
1102 1102 changeset: 4:88176d361b69
1103 1103 user: test
1104 1104 date: Thu Jan 01 00:00:00 1970 +0000
1105 1105 summary: add foo, related
1106 1106
1107 1107
1108 1108 Also check when maxrev < lastrevfilelog
1109 1109
1110 1110 $ hg --traceback log -f -r4 foo
1111 1111 changeset: 4:88176d361b69
1112 1112 user: test
1113 1113 date: Thu Jan 01 00:00:00 1970 +0000
1114 1114 summary: add foo, related
1115 1115
1116 1116 $ cd ..
1117 1117
1118 1118 Issue2383: hg log showing _less_ differences than hg diff
1119 1119
1120 1120 $ hg init issue2383
1121 1121 $ cd issue2383
1122 1122
1123 1123 Create a test repo:
1124 1124
1125 1125 $ echo a > a
1126 1126 $ hg ci -Am0
1127 1127 adding a
1128 1128 $ echo b > b
1129 1129 $ hg ci -Am1
1130 1130 adding b
1131 1131 $ hg co 0
1132 1132 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1133 1133 $ echo b > a
1134 1134 $ hg ci -m2
1135 1135 created new head
1136 1136
1137 1137 Merge:
1138 1138
1139 1139 $ hg merge
1140 1140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1141 1141 (branch merge, don't forget to commit)
1142 1142
1143 1143 Make sure there's a file listed in the merge to trigger the bug:
1144 1144
1145 1145 $ echo c > a
1146 1146 $ hg ci -m3
1147 1147
1148 1148 Two files shown here in diff:
1149 1149
1150 1150 $ hg diff --rev 2:3
1151 1151 diff -r b09be438c43a -r 8e07aafe1edc a
1152 1152 --- a/a Thu Jan 01 00:00:00 1970 +0000
1153 1153 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1154 1154 @@ -1,1 +1,1 @@
1155 1155 -b
1156 1156 +c
1157 1157 diff -r b09be438c43a -r 8e07aafe1edc b
1158 1158 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1159 1159 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1160 1160 @@ -0,0 +1,1 @@
1161 1161 +b
1162 1162
1163 1163 Diff here should be the same:
1164 1164
1165 1165 $ hg log -vpr 3
1166 1166 changeset: 3:8e07aafe1edc
1167 1167 tag: tip
1168 1168 parent: 2:b09be438c43a
1169 1169 parent: 1:925d80f479bb
1170 1170 user: test
1171 1171 date: Thu Jan 01 00:00:00 1970 +0000
1172 1172 files: a
1173 1173 description:
1174 1174 3
1175 1175
1176 1176
1177 1177 diff -r b09be438c43a -r 8e07aafe1edc a
1178 1178 --- a/a Thu Jan 01 00:00:00 1970 +0000
1179 1179 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1180 1180 @@ -1,1 +1,1 @@
1181 1181 -b
1182 1182 +c
1183 1183 diff -r b09be438c43a -r 8e07aafe1edc b
1184 1184 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1185 1185 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1186 1186 @@ -0,0 +1,1 @@
1187 1187 +b
1188 1188
1189 1189 $ cd ..
1190 1190
1191 1191 'hg log -r rev fn' when last(filelog(fn)) != rev
1192 1192
1193 1193 $ hg init simplelog
1194 1194 $ cd simplelog
1195 1195 $ echo f > a
1196 1196 $ hg ci -Am'a' -d '0 0'
1197 1197 adding a
1198 1198 $ echo f >> a
1199 1199 $ hg ci -Am'a bis' -d '1 0'
1200 1200
1201 1201 $ hg log -r0 a
1202 1202 changeset: 0:9f758d63dcde
1203 1203 user: test
1204 1204 date: Thu Jan 01 00:00:00 1970 +0000
1205 1205 summary: a
1206 1206
1207 1207 enable obsolete to test hidden feature
1208 1208
1209 1209 $ cat > ${TESTTMP}/obs.py << EOF
1210 1210 > import mercurial.obsolete
1211 1211 > mercurial.obsolete._enabled = True
1212 1212 > EOF
1213 1213 $ echo '[extensions]' >> $HGRCPATH
1214 1214 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
1215 1215
1216 1216 $ hg log --template='{rev}:{node}\n'
1217 1217 1:a765632148dc55d38c35c4f247c618701886cb2f
1218 1218 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1219 1219 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1220 1220 $ hg up null -q
1221 1221 $ hg log --template='{rev}:{node}\n'
1222 1222 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1223 1223 $ hg log --template='{rev}:{node}\n' --hidden
1224 1224 1:a765632148dc55d38c35c4f247c618701886cb2f
1225 1225 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1226 1226
1227 1227 test that parent prevent a changeset to be hidden
1228 1228
1229 1229 $ hg up 1 -q --hidden
1230 1230 $ hg log --template='{rev}:{node}\n'
1231 1231 1:a765632148dc55d38c35c4f247c618701886cb2f
1232 1232 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1233 1233
1234 1234 test that second parent prevent a changeset to be hidden too
1235 1235
1236 1236 $ hg debugsetparents 0 1 # nothing suitable to merge here
1237 1237 $ hg log --template='{rev}:{node}\n'
1238 1238 1:a765632148dc55d38c35c4f247c618701886cb2f
1239 1239 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1240 1240 $ hg debugsetparents 1
1241 1241 $ hg up -q null
1242 1242
1243 1243 bookmarks prevent a changeset being hidden
1244 1244
1245 1245 $ hg bookmark --hidden -r 1 X
1246 1246 $ hg log --template '{rev}:{node}\n'
1247 1247 1:a765632148dc55d38c35c4f247c618701886cb2f
1248 1248 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1249 1249 $ hg bookmark -d X
1250 1250
1251 1251 divergent bookmarks are not hidden
1252 1252
1253 1253 $ hg bookmark --hidden -r 1 X@foo
1254 1254 $ hg log --template '{rev}:{node}\n'
1255 1255 1:a765632148dc55d38c35c4f247c618701886cb2f
1256 1256 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1257 1257
1258 1258 clear extensions configuration
1259 1259 $ echo '[extensions]' >> $HGRCPATH
1260 1260 $ echo "obs=!" >> $HGRCPATH
1261 1261 $ cd ..
1262 1262
1263 1263 test -u/-k for problematic encoding
1264 1264 # unicode: cp932:
1265 1265 # u30A2 0x83 0x41(= 'A')
1266 1266 # u30C2 0x83 0x61(= 'a')
1267 1267
1268 1268 $ hg init problematicencoding
1269 1269 $ cd problematicencoding
1270 1270
1271 1271 $ python > setup.sh <<EOF
1272 1272 > print u'''
1273 1273 > echo a > text
1274 1274 > hg add text
1275 1275 > hg --encoding utf-8 commit -u '\u30A2' -m none
1276 1276 > echo b > text
1277 1277 > hg --encoding utf-8 commit -u '\u30C2' -m none
1278 1278 > echo c > text
1279 1279 > hg --encoding utf-8 commit -u none -m '\u30A2'
1280 1280 > echo d > text
1281 1281 > hg --encoding utf-8 commit -u none -m '\u30C2'
1282 1282 > '''.encode('utf-8')
1283 1283 > EOF
1284 1284 $ sh < setup.sh
1285 1285
1286 1286 test in problematic encoding
1287 1287 $ python > test.sh <<EOF
1288 1288 > print u'''
1289 1289 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1290 1290 > echo ====
1291 1291 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1292 1292 > echo ====
1293 1293 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1294 1294 > echo ====
1295 1295 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1296 1296 > '''.encode('cp932')
1297 1297 > EOF
1298 1298 $ sh < test.sh
1299 1299 0
1300 1300 ====
1301 1301 1
1302 1302 ====
1303 1303 2
1304 1304 0
1305 1305 ====
1306 1306 3
1307 1307 1
1308 1308
1309 1309 $ cd ..
1310 1310
1311 1311 test hg log on non-existent files and on directories
1312 1312 $ hg init issue1340
1313 1313 $ cd issue1340
1314 1314 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1315 1315 $ echo 1 > d1/f1
1316 1316 $ echo 1 > D2/f1
1317 1317 $ echo 1 > D3.i/f1
1318 1318 $ echo 1 > d4.hg/f1
1319 1319 $ echo 1 > d5.d/f1
1320 1320 $ echo 1 > .d6/f1
1321 1321 $ hg -q add .
1322 1322 $ hg commit -m "a bunch of weird directories"
1323 1323 $ hg log -l1 d1/f1 | grep changeset
1324 1324 changeset: 0:65624cd9070a
1325 1325 $ hg log -l1 f1
1326 1326 $ hg log -l1 . | grep changeset
1327 1327 changeset: 0:65624cd9070a
1328 1328 $ hg log -l1 ./ | grep changeset
1329 1329 changeset: 0:65624cd9070a
1330 1330 $ hg log -l1 d1 | grep changeset
1331 1331 changeset: 0:65624cd9070a
1332 1332 $ hg log -l1 D2 | grep changeset
1333 1333 changeset: 0:65624cd9070a
1334 1334 $ hg log -l1 D2/f1 | grep changeset
1335 1335 changeset: 0:65624cd9070a
1336 1336 $ hg log -l1 D3.i | grep changeset
1337 1337 changeset: 0:65624cd9070a
1338 1338 $ hg log -l1 D3.i/f1 | grep changeset
1339 1339 changeset: 0:65624cd9070a
1340 1340 $ hg log -l1 d4.hg | grep changeset
1341 1341 changeset: 0:65624cd9070a
1342 1342 $ hg log -l1 d4.hg/f1 | grep changeset
1343 1343 changeset: 0:65624cd9070a
1344 1344 $ hg log -l1 d5.d | grep changeset
1345 1345 changeset: 0:65624cd9070a
1346 1346 $ hg log -l1 d5.d/f1 | grep changeset
1347 1347 changeset: 0:65624cd9070a
1348 1348 $ hg log -l1 .d6 | grep changeset
1349 1349 changeset: 0:65624cd9070a
1350 1350 $ hg log -l1 .d6/f1 | grep changeset
1351 1351 changeset: 0:65624cd9070a
1352 1352
1353 1353 issue3772: hg log -r :null showing revision 0 as well
1354 1354
1355 1355 $ hg log -r :null
1356 1356 changeset: -1:000000000000
1357 1357 user:
1358 1358 date: Thu Jan 01 00:00:00 1970 +0000
1359 1359
1360 1360 $ hg log -r null:null
1361 1361 changeset: -1:000000000000
1362 1362 user:
1363 1363 date: Thu Jan 01 00:00:00 1970 +0000
1364 1364
1365 1365
1366 1366 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now