##// END OF EJS Templates
patch: check length of git index header only if integer is specified...
Yuya Nishihara -
r30819:89772662 default
parent child Browse files
Show More
@@ -2184,6 +2184,9 b' def difffeatureopts(ui, opts=None, untru'
2184 # the hash config could be an integer (for length of hash) or a
2184 # the hash config could be an integer (for length of hash) or a
2185 # word (e.g. short, full, none)
2185 # word (e.g. short, full, none)
2186 hlen = int(hconf)
2186 hlen = int(hconf)
2187 if hlen < 0 or hlen > 40:
2188 msg = _("invalid length for extendedheader.index: '%d'\n")
2189 ui.warn(msg % hlen)
2187 except ValueError:
2190 except ValueError:
2188 # default value
2191 # default value
2189 if hconf == 'short' or hconf == '':
2192 if hconf == 'short' or hconf == '':
@@ -2194,9 +2197,6 b' def difffeatureopts(ui, opts=None, untru'
2194 msg = _("invalid value for extendedheader.index: '%s'\n")
2197 msg = _("invalid value for extendedheader.index: '%s'\n")
2195 ui.warn(msg % hconf)
2198 ui.warn(msg % hconf)
2196 finally:
2199 finally:
2197 if hlen < 0 or hlen > 40:
2198 msg = _("invalid length for extendedheader.index: '%d'\n")
2199 ui.warn(msg % hlen)
2200 buildopts['index'] = hlen
2200 buildopts['index'] = hlen
2201
2201
2202 if whitespace:
2202 if whitespace:
@@ -243,6 +243,28 b' Git diff, adding extended headers'
243 -a
243 -a
244 +b
244 +b
245
245
246 $ hg diff --git --config experimental.extendedheader.index=-1
247 invalid length for extendedheader.index: '-1'
248 diff --git a/f1 b/f 1
249 rename from f1
250 rename to f 1
251 --- a/f1
252 +++ b/f 1
253 @@ -1,1 +1,1 @@
254 -a
255 +b
256
257 $ hg diff --git --config experimental.extendedheader.index=whatever
258 invalid value for extendedheader.index: 'whatever'
259 diff --git a/f1 b/f 1
260 rename from f1
261 rename to f 1
262 --- a/f1
263 +++ b/f 1
264 @@ -1,1 +1,1 @@
265 -a
266 +b
267
246 Git diff with noprefix
268 Git diff with noprefix
247
269
248 $ hg --config diff.noprefix=True diff --git --nodates
270 $ hg --config diff.noprefix=True diff --git --nodates
General Comments 0
You need to be logged in to leave comments. Login now