Skip to content

Commit a47c67e

Browse files
quark-zjufacebook-github-bot
authored andcommitted
ui: use explicit None to get ui.formatted and ui.interactive
Summary: This is subtle. `configbool` by default returns `False` for "unset" configs. However, with `coreconfigitem(a, b, default=None)`, `configbool(a, b)` will return `None`. I'm removing `coreconfigitem`s so let's use explicit `None` for those tricky `configbool`s. Reviewed By: muirdm Differential Revision: D74336719 fbshipit-source-id: 048ca326ab3af378a31b79742d58a574bfe8302f
1 parent 43e836b commit a47c67e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

eden/scm/sapling/ui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ def interactive(self):
960960
961961
This function refers to input only; for output, see `ui.formatted()'.
962962
"""
963-
i = self.configbool("ui", "interactive")
963+
i = self.configbool("ui", "interactive", None)
964964
if i is None:
965965
# some environments replace stdin without implementing isatty
966966
# usually those are non-interactive
@@ -1005,7 +1005,7 @@ def formatted(self):
10051005
if self.plain():
10061006
return False
10071007

1008-
i = self.configbool("ui", "formatted")
1008+
i = self.configbool("ui", "formatted", None)
10091009
if i is None:
10101010
# some environments replace stdout without implementing isatty
10111011
# usually those are non-interactive

0 commit comments

Comments
 (0)