##// END OF EJS Templates
journal: inline formatted nodes and date into expression...
Yuya Nishihara -
r39738:a7b91509 default
parent child Browse files
Show More
@@ -477,6 +477,8 b' def journal(ui, repo, *args, **opts):'
477 name = args[0]
477 name = args[0]
478
478
479 fm = ui.formatter('journal', opts)
479 fm = ui.formatter('journal', opts)
480 def formatnodes(nodes):
481 return fm.formatlist(map(fm.hexfunc, nodes), name='node', sep=',')
480
482
481 if opts.get("template") != "json":
483 if opts.get("template") != "json":
482 if name is None:
484 if name is None:
@@ -491,21 +493,18 b' def journal(ui, repo, *args, **opts):'
491 for count, entry in enumerate(repo.journal.filtered(name=name)):
493 for count, entry in enumerate(repo.journal.filtered(name=name)):
492 if count == limit:
494 if count == limit:
493 break
495 break
494 newhashesstr = fm.formatlist(map(fm.hexfunc, entry.newhashes),
495 name='node', sep=',')
496 oldhashesstr = fm.formatlist(map(fm.hexfunc, entry.oldhashes),
497 name='node', sep=',')
498
496
499 fm.startitem()
497 fm.startitem()
500 fm.condwrite(ui.verbose, 'oldnodes', '%s -> ', oldhashesstr)
498 fm.condwrite(ui.verbose, 'oldnodes', '%s -> ',
501 fm.write('newnodes', '%s', newhashesstr)
499 formatnodes(entry.oldhashes))
500 fm.write('newnodes', '%s', formatnodes(entry.newhashes))
502 fm.condwrite(ui.verbose, 'user', ' %-8s', entry.user)
501 fm.condwrite(ui.verbose, 'user', ' %-8s', entry.user)
503 fm.condwrite(
502 fm.condwrite(
504 opts.get('all') or name.startswith('re:'),
503 opts.get('all') or name.startswith('re:'),
505 'name', ' %-8s', entry.name)
504 'name', ' %-8s', entry.name)
506
505
507 timestring = fm.formatdate(entry.timestamp, '%Y-%m-%d %H:%M %1%2')
506 fm.condwrite(ui.verbose, 'date', ' %s',
508 fm.condwrite(ui.verbose, 'date', ' %s', timestring)
507 fm.formatdate(entry.timestamp, '%Y-%m-%d %H:%M %1%2'))
509 fm.write('command', ' %s\n', entry.command)
508 fm.write('command', ' %s\n', entry.command)
510
509
511 if opts.get("commits"):
510 if opts.get("commits"):
General Comments 0
You need to be logged in to leave comments. Login now