comparison mercurial/patch.py @ 6467:65029a3aafc2

Let --unified default to diff.unified (issue 1076)
author Patrick Mezard <pmezard@gmail.com>
date Fri, 04 Apr 2008 22:15:14 +0200
parents bace1990ab12
children ac0bcd951c2c ba0b2dacc623
comparison
equal deleted inserted replaced
6459:8189e03adb44 6467:65029a3aafc2
1053 if rejects: 1053 if rejects:
1054 return -1 1054 return -1
1055 return err 1055 return err
1056 1056
1057 def diffopts(ui, opts={}, untrusted=False): 1057 def diffopts(ui, opts={}, untrusted=False):
1058 def get(key, name=None): 1058 def get(key, name=None, getter=ui.configbool):
1059 return (opts.get(key) or 1059 return (opts.get(key) or
1060 ui.configbool('diff', name or key, None, untrusted=untrusted)) 1060 getter('diff', name or key, None, untrusted=untrusted))
1061 return mdiff.diffopts( 1061 return mdiff.diffopts(
1062 text=opts.get('text'), 1062 text=opts.get('text'),
1063 git=get('git'), 1063 git=get('git'),
1064 nodates=get('nodates'), 1064 nodates=get('nodates'),
1065 showfunc=get('show_function', 'showfunc'), 1065 showfunc=get('show_function', 'showfunc'),
1066 ignorews=get('ignore_all_space', 'ignorews'), 1066 ignorews=get('ignore_all_space', 'ignorews'),
1067 ignorewsamount=get('ignore_space_change', 'ignorewsamount'), 1067 ignorewsamount=get('ignore_space_change', 'ignorewsamount'),
1068 ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines'), 1068 ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines'),
1069 context=get('unified')) 1069 context=get('unified', getter=ui.config))
1070 1070
1071 def updatedir(ui, repo, patches): 1071 def updatedir(ui, repo, patches):
1072 '''Update dirstate after patch application according to metadata''' 1072 '''Update dirstate after patch application according to metadata'''
1073 if not patches: 1073 if not patches:
1074 return 1074 return