comparison mercurial/ui.py @ 32579:012e0da5b759

formatter: add option to redirect output to file object Commands like 'export' have --output=OUTFILESPEC option, so we need a way to write formatter output optionally to a file.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Jan 2015 18:04:44 +0900
parents bb18728ea617
children 9fcb6df413c9
comparison
equal deleted inserted replaced
32571:b6612d8579e4 32579:012e0da5b759
261 finally: 261 finally:
262 self._blockedtimes[key + '_blocked'] += \ 262 self._blockedtimes[key + '_blocked'] += \
263 (util.timer() - starttime) * 1000 263 (util.timer() - starttime) * 1000
264 264
265 def formatter(self, topic, opts): 265 def formatter(self, topic, opts):
266 return formatter.formatter(self, topic, opts) 266 return formatter.formatter(self, self, topic, opts)
267 267
268 def _trusted(self, fp, f): 268 def _trusted(self, fp, f):
269 st = util.fstat(fp) 269 st = util.fstat(fp)
270 if util.isowner(st): 270 if util.isowner(st):
271 return True 271 return True