equal
deleted
inserted
replaced
572 Note: there are a variety of convenience functions to build a |
572 Note: there are a variety of convenience functions to build a |
573 changesettemplater for common cases. See functions such as: |
573 changesettemplater for common cases. See functions such as: |
574 maketemplater, changesetdisplayer, buildcommittemplate, or other |
574 maketemplater, changesetdisplayer, buildcommittemplate, or other |
575 functions that use changesest_templater. |
575 functions that use changesest_templater. |
576 """ |
576 """ |
|
577 |
|
578 _tresources: formatter.templateresources |
|
579 lastheader: Optional[bytes] |
|
580 t: templater.templater |
577 |
581 |
578 # Arguments before "buffered" used to be positional. Consider not |
582 # Arguments before "buffered" used to be positional. Consider not |
579 # adding/removing arguments before "buffered" to not break callers. |
583 # adding/removing arguments before "buffered" to not break callers. |
580 def __init__( |
584 def __init__( |
581 self, ui, repo, tmplspec, differ=None, diffopts=None, buffered=False |
585 self, ui, repo, tmplspec, differ=None, diffopts=None, buffered=False |
663 if self._parts[b'footer']: |
667 if self._parts[b'footer']: |
664 if not self.footer: |
668 if not self.footer: |
665 self.footer = self.t.render(self._parts[b'footer'], props) |
669 self.footer = self.t.render(self._parts[b'footer'], props) |
666 |
670 |
667 |
671 |
668 def templatespec(tmpl, mapfile): |
672 def templatespec(tmpl, mapfile) -> formatter.templatespec: |
669 assert not (tmpl and mapfile) |
673 assert not (tmpl and mapfile) |
670 if mapfile: |
674 if mapfile: |
671 return formatter.mapfile_templatespec(b'changeset', mapfile) |
675 return formatter.mapfile_templatespec(b'changeset', mapfile) |
672 else: |
676 else: |
673 return formatter.literal_templatespec(tmpl) |
677 return formatter.literal_templatespec(tmpl) |
674 |
678 |
675 |
679 |
676 def _lookuptemplate(ui, tmpl, style): |
680 def _lookuptemplate(ui, tmpl, style) -> formatter.templatespec: |
677 """Find the template matching the given template spec or style |
681 """Find the template matching the given template spec or style |
678 |
682 |
679 See formatter.lookuptemplate() for details. |
683 See formatter.lookuptemplate() for details. |
680 """ |
684 """ |
681 |
685 |