Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/ui.py @ 2166:d0c02b4dce9a
do not check sys.argv from localrepo when running hooks.
instead add traceback field to ui class.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Sun, 30 Apr 2006 16:30:39 -0700 |
parents | 74d3f5336b66 |
children | 9f43b6e24232 |
comparison
equal
deleted
inserted
replaced
2164:cbd458228a96 | 2166:d0c02b4dce9a |
---|---|
10 from demandload import * | 10 from demandload import * |
11 demandload(globals(), "errno os re socket sys tempfile util") | 11 demandload(globals(), "errno os re socket sys tempfile util") |
12 | 12 |
13 class ui(object): | 13 class ui(object): |
14 def __init__(self, verbose=False, debug=False, quiet=False, | 14 def __init__(self, verbose=False, debug=False, quiet=False, |
15 interactive=True, parentui=None): | 15 interactive=True, traceback=False, parentui=None): |
16 self.overlay = {} | 16 self.overlay = {} |
17 if parentui is None: | 17 if parentui is None: |
18 # this is the parent of all ui children | 18 # this is the parent of all ui children |
19 self.parentui = None | 19 self.parentui = None |
20 self.cdata = ConfigParser.SafeConfigParser() | 20 self.cdata = ConfigParser.SafeConfigParser() |
22 | 22 |
23 self.quiet = self.configbool("ui", "quiet") | 23 self.quiet = self.configbool("ui", "quiet") |
24 self.verbose = self.configbool("ui", "verbose") | 24 self.verbose = self.configbool("ui", "verbose") |
25 self.debugflag = self.configbool("ui", "debug") | 25 self.debugflag = self.configbool("ui", "debug") |
26 self.interactive = self.configbool("ui", "interactive", True) | 26 self.interactive = self.configbool("ui", "interactive", True) |
27 self.traceback = traceback | |
27 | 28 |
28 self.updateopts(verbose, debug, quiet, interactive) | 29 self.updateopts(verbose, debug, quiet, interactive) |
29 self.diffcache = None | 30 self.diffcache = None |
30 self.header = [] | 31 self.header = [] |
31 self.prev_header = [] | 32 self.prev_header = [] |
43 | 44 |
44 def __getattr__(self, key): | 45 def __getattr__(self, key): |
45 return getattr(self.parentui, key) | 46 return getattr(self.parentui, key) |
46 | 47 |
47 def updateopts(self, verbose=False, debug=False, quiet=False, | 48 def updateopts(self, verbose=False, debug=False, quiet=False, |
48 interactive=True): | 49 interactive=True, traceback=False): |
49 self.quiet = (self.quiet or quiet) and not verbose and not debug | 50 self.quiet = (self.quiet or quiet) and not verbose and not debug |
50 self.verbose = (self.verbose or verbose) or debug | 51 self.verbose = (self.verbose or verbose) or debug |
51 self.debugflag = (self.debugflag or debug) | 52 self.debugflag = (self.debugflag or debug) |
52 self.interactive = (self.interactive and interactive) | 53 self.interactive = (self.interactive and interactive) |
54 self.traceback = self.traceback or traceback | |
53 | 55 |
54 def readconfig(self, fn, root=None): | 56 def readconfig(self, fn, root=None): |
55 if isinstance(fn, basestring): | 57 if isinstance(fn, basestring): |
56 fn = [fn] | 58 fn = [fn] |
57 for f in fn: | 59 for f in fn: |