comparison mercurial/ui.py @ 16135:ae5f92e154d3

ui: add formatter method
author Matt Mackall <mpm@selenic.com>
date Mon, 20 Feb 2012 16:42:48 -0600
parents 69e792cf7851
children 329887a7074c
comparison
equal deleted inserted replaced
16134:3c0327ea20c0 16135:ae5f92e154d3
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 7
8 from i18n import _ 8 from i18n import _
9 import errno, getpass, os, socket, sys, tempfile, traceback 9 import errno, getpass, os, socket, sys, tempfile, traceback
10 import config, scmutil, util, error 10 import config, scmutil, util, error, formatter
11 11
12 class ui(object): 12 class ui(object):
13 def __init__(self, src=None): 13 def __init__(self, src=None):
14 self._buffers = [] 14 self._buffers = []
15 self.quiet = self.verbose = self.debugflag = self.tracebackflag = False 15 self.quiet = self.verbose = self.debugflag = self.tracebackflag = False
43 for f in scmutil.rcpath(): 43 for f in scmutil.rcpath():
44 self.readconfig(f, trust=True) 44 self.readconfig(f, trust=True)
45 45
46 def copy(self): 46 def copy(self):
47 return self.__class__(self) 47 return self.__class__(self)
48
49 def formatter(self, topic, opts):
50 return formatter.formatter(self, topic, opts)
48 51
49 def _trusted(self, fp, f): 52 def _trusted(self, fp, f):
50 st = util.fstat(fp) 53 st = util.fstat(fp)
51 if util.isowner(st): 54 if util.isowner(st):
52 return True 55 return True