mercurial/formatter.py
changeset 29886 307b20e5e505
parent 29848 5b886289a1ca
child 29953 e7cacb45c4be
equal deleted inserted replaced
29885:12f8bef59bfa 29886:307b20e5e505
    50         self._template = opts.get("template")
    50         self._template = opts.get("template")
    51         self._converter = converter
    51         self._converter = converter
    52         self._item = None
    52         self._item = None
    53         # function to convert node to string suitable for this output
    53         # function to convert node to string suitable for this output
    54         self.hexfunc = hex
    54         self.hexfunc = hex
       
    55     def __enter__(self):
       
    56         return self
       
    57     def __exit__(self, exctype, excvalue, traceback):
       
    58         if exctype is None:
       
    59             self.end()
    55     def __nonzero__(self):
    60     def __nonzero__(self):
    56         '''return False if we're not doing real templating so we can
    61         '''return False if we're not doing real templating so we can
    57         skip extra work'''
    62         skip extra work'''
    58         return True
    63         return True
    59     def _showitem(self):
    64     def _showitem(self):