Mercurial > hg > mercurial-crew-with-dirclash
diff mercurial/ui.py @ 2899:bee4b7abcb01
Merge with crew
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 14 Aug 2006 14:42:15 -0500 |
parents | 4ec58b157265 |
children | 8b02af865990 3848488244fc |
line wrap: on
line diff
--- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1,6 +1,6 @@ # ui.py - user interface bits for mercurial # -# Copyright 2005 Matt Mackall <mpm@selenic.com> +# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. @@ -8,7 +8,7 @@ from i18n import gettext as _ from demandload import * demandload(globals(), "errno getpass os re smtplib socket sys tempfile") -demandload(globals(), "ConfigParser templater traceback util") +demandload(globals(), "ConfigParser mdiff templater traceback util") class ui(object): def __init__(self, verbose=False, debug=False, quiet=False, @@ -169,16 +169,17 @@ class ui(object): result[key.lower()] = value return result - def diffopts(self): - if self.diffcache: - return self.diffcache - result = {'showfunc': True, 'ignorews': False, - 'ignorewsamount': False, 'ignoreblanklines': False} - for key, value in self.configitems("diff"): - if value: - result[key.lower()] = (value.lower() == 'true') - self.diffcache = result - return result + def diffopts(self, opts={}): + return mdiff.diffopts( + text=opts.get('text'), + showfunc=(opts.get('show_function') or + self.configbool('diff', 'showfunc', None)), + ignorews=(opts.get('ignore_all_space') or + self.configbool('diff', 'ignorews', None)), + ignorewsamount=(opts.get('ignore_space_change') or + self.configbool('diff', 'ignorewsamount', None)), + ignoreblanklines=(opts.get('ignore_blank_lines') or + self.configbool('diff', 'ignoreblanklines', None))) def username(self): """Return default username to be used in commits.