diff --git a/mercurial/fancyopts.py b/mercurial/fancyopts.py --- a/mercurial/fancyopts.py +++ b/mercurial/fancyopts.py @@ -11,7 +11,8 @@ def fancyopts(args, options, state): map['-'+s] = map['--'+l] = pl state[pl] = d dt[pl] = type(d) - if not d is None and not callable(d): + if (d is not None and d is not True and d is not False and + not callable(d)): if s: s += ':' if l: l += '=' if s: short = short + s @@ -25,6 +26,7 @@ def fancyopts(args, options, state): elif dt[map[opt]] is type(''): state[map[opt]] = arg elif dt[map[opt]] is type([]): state[map[opt]].append(arg) elif dt[map[opt]] is type(None): state[map[opt]] = True + elif dt[map[opt]] is type(False): state[map[opt]] = True return args diff --git a/tests/test-issue436 b/tests/test-issue436 --- a/tests/test-issue436 +++ b/tests/test-issue436 @@ -2,5 +2,6 @@ hg init a cd a +hg -v log -v hg -v log -v x true