comparison mercurial/cmdutil.py @ 5545:5a124ce4602a

cmdutil: always expose "files_add", "files_del" and "manifest" templater properties
author Patrick Mezard <pmezard@gmail.com>
date Sat, 24 Nov 2007 17:56:15 +0100
parents 7a64931e2d76
children db6633f11d59
comparison
equal deleted inserted replaced
5540:00b812ad67cb 5545:5a124ce4602a
569 yield self.t('extra', **args) 569 yield self.t('extra', **args)
570 570
571 def showcopies(**args): 571 def showcopies(**args):
572 c = [{'name': x[0], 'source': x[1]} for x in copies] 572 c = [{'name': x[0], 'source': x[1]} for x in copies]
573 return showlist('file_copy', c, plural='file_copies', **args) 573 return showlist('file_copy', c, plural='file_copies', **args)
574 574
575 files = []
576 def getfiles():
577 if not files:
578 files[:] = self.repo.status(
579 log.parents(changenode)[0], changenode)[:3]
580 return files
581 # XXX: "files" means "modified files" in debug, "all changed
582 # files" otherwise. This should be fixed and a "file_mods" be
583 # introduced instead.
575 if self.ui.debugflag: 584 if self.ui.debugflag:
576 files = self.repo.status(log.parents(changenode)[0], changenode)[:3]
577 def showfiles(**args): 585 def showfiles(**args):
578 return showlist('file', files[0], **args) 586 return showlist('file', getfiles()[0], **args)
579 def showadds(**args):
580 return showlist('file_add', files[1], **args)
581 def showdels(**args):
582 return showlist('file_del', files[2], **args)
583 def showmanifest(**args):
584 args = args.copy()
585 args.update(dict(rev=self.repo.manifest.rev(changes[0]),
586 node=hex(changes[0])))
587 return self.t('manifest', **args)
588 else: 587 else:
589 def showfiles(**args): 588 def showfiles(**args):
590 return showlist('file', changes[3], **args) 589 return showlist('file', changes[3], **args)
591 showadds = '' 590 def showadds(**args):
592 showdels = '' 591 return showlist('file_add', getfiles()[1], **args)
593 showmanifest = '' 592 def showdels(**args):
593 return showlist('file_del', getfiles()[2], **args)
594 def showmanifest(**args):
595 args = args.copy()
596 args.update(dict(rev=self.repo.manifest.rev(changes[0]),
597 node=hex(changes[0])))
598 return self.t('manifest', **args)
594 599
595 defprops = { 600 defprops = {
596 'author': changes[1], 601 'author': changes[1],
597 'branches': showbranches, 602 'branches': showbranches,
598 'date': changes[2], 603 'date': changes[2],