##// END OF EJS Templates
diffopts: notice a negated boolean flag in diffopts...
Augie Fackler -
r29948:e40343ce default
parent child Browse files
Show More
@@ -2144,7 +2144,14 b' def difffeatureopts(ui, opts=None, untru'
2144 def get(key, name=None, getter=ui.configbool, forceplain=None):
2144 def get(key, name=None, getter=ui.configbool, forceplain=None):
2145 if opts:
2145 if opts:
2146 v = opts.get(key)
2146 v = opts.get(key)
2147 if v:
2147 # diffopts flags are either None-default (which is passed
2148 # through unchanged, so we can identify unset values), or
2149 # some other falsey default (eg --unified, which defaults
2150 # to an empty string). We only want to override the config
2151 # entries from hgrc with command line values if they
2152 # appear to have been set, which is any truthy value,
2153 # True, or False.
2154 if v or isinstance(v, bool):
2148 return v
2155 return v
2149 if forceplain is not None and ui.plain():
2156 if forceplain is not None and ui.plain():
2150 return forceplain
2157 return forceplain
@@ -333,4 +333,20 b' showfunc diff'
333 + return a + b + c + e;
333 + return a + b + c + e;
334 }
334 }
335
335
336 If [diff] git is set to true, but the user says --no-git, we should
337 *not* get git diffs
338 $ hg diff --nodates --config diff.git=1 --no-git
339 diff -r f2c7c817fa55 f1
340 --- a/f1
341 +++ b/f1
342 @@ -2,6 +2,6 @@
343 int a = 0;
344 int b = 1;
345 int c = 2;
346 - int d = 3;
347 - return a + b + c + d;
348 + int e = 3;
349 + return a + b + c + e;
350 }
351
336 $ cd ..
352 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now