##// END OF EJS Templates
patch: add config knob for displaying the index header...
Sean Farley -
r30788:d1901c4c default
parent child Browse files
Show More
@@ -52,6 +52,7 b' class diffopts(object):'
52 'nodates': False,
52 'nodates': False,
53 'nobinary': False,
53 'nobinary': False,
54 'noprefix': False,
54 'noprefix': False,
55 'index': 0,
55 'ignorews': False,
56 'ignorews': False,
56 'ignorewsamount': False,
57 'ignorewsamount': False,
57 'ignoreblanklines': False,
58 'ignoreblanklines': False,
@@ -2168,6 +2168,31 b' def difffeatureopts(ui, opts=None, untru'
2168
2168
2169 if git:
2169 if git:
2170 buildopts['git'] = get('git')
2170 buildopts['git'] = get('git')
2171
2172 # need to inspect the ui object instead of using get() since we want to
2173 # test for an int
2174 hconf = ui.config('experimental', 'extendedheader.index')
2175 if hconf is not None:
2176 hlen = None
2177 try:
2178 # the hash config could be an integer (for length of hash) or a
2179 # word (e.g. short, full, none)
2180 hlen = int(hconf)
2181 except ValueError:
2182 # default value
2183 if hconf == 'short' or hconf == '':
2184 hlen = 12
2185 elif hconf == 'full':
2186 hlen = 40
2187 elif hconf != 'none':
2188 msg = _("invalid value for extendedheader.index: '%s'\n")
2189 ui.warn(msg % hconf)
2190 finally:
2191 if hlen < 0 or hlen > 40:
2192 msg = _("invalid length for extendedheader.index: '%d'\n")
2193 ui.warn(msg % hlen)
2194 buildopts['index'] = hlen
2195
2171 if whitespace:
2196 if whitespace:
2172 buildopts['ignorews'] = get('ignore_all_space', 'ignorews')
2197 buildopts['ignorews'] = get('ignore_all_space', 'ignorews')
2173 buildopts['ignorewsamount'] = get('ignore_space_change',
2198 buildopts['ignorewsamount'] = get('ignore_space_change',
General Comments 0
You need to be logged in to leave comments. Login now