py3: use pycompat.fsencode() to convert __file__ to bytes
__file__ returns unicodes on Python 3. This patch uses pycompat.fsencode() to
convert them to bytes.
wireproto: remove unused code
Removed an unused line introduced by
f3807a135e43.
color: set initial default value for 'colormode' to None
This should not introduce any behavior changes when using the color extension.
In practive, the colormode will be setup at early at run time to the proper
value (from config and environment).
We do this change as this gets us closer of a state were we can have all the
mechanisms associated to color in core with the feature disabled by default.
color: minor reversal of two conditional clause for clarity
Another minor cleanup while reading the code. The two branches of the conditional
have similar complexity so we go for the order that give us the simplest
condition (we drop the negation).
color: merge two identical 'for' loops
The previous changeset made it clear that we are iterating twice on the same
items. We gather the two loops into a single one.
color: minor simplification of some terminfo setup code
No logic change is introduced. The previous code were using a 'dict.update' with
a complex generator. That was a bit confusing to read and not so compact.
Instead we now use an explicit loop and conditional for the sake of clarity.
This also allow for more simplification coming in the next changeset.