color: stop mutating the default effects map
A future change will make color.setup() callable a second time when the pager is
spawned, in order to honor the 'color.pagermode' setting. The problem was that
when 'color.mode=auto' was resolved to 'win32' in the first pass, the default
ANSI effects were overwritten, making it impossible to honor 'pagermode=ansi'.
Also, the two separate maps didn't have the same keys. The symmetric difference
is 'dim' and 'italic' (from ANSI), and 'bold_background' (from win32). Thus,
the update left entries that didn't belong for the current mode. This bled
through `hg debugcolor`, where the unsupported ANSI keys were listed in 'win32'
mode.
As an added bonus, this now correctly enables color with MSYS `less` for a
command like this, where pager is forced on:
$ hg log --config color.pagermode=ansi --pager=yes --color=auto
Previously, the output was corrupted. The raw output, as seen through the ANSI
blind `more.com` was:
<-[-1;6mchangeset: 34840:
3580d1197af9<-[-1m
...
which MSYS `less -FRX` rendered as:
1;6mchangeset: 34840:
3580d1197af91m
...
(The two '<-' instances were actually an arrow character that TortoiseHg warned
couldn't be encoded, and notepad++ translated to a single '?'.)
Returning an empty map for 'ui._colormode == None' seems better that defaulting
to '_effects' (since some keys are mode dependent), and is better than None,
which blows up `hg debugcolor --color=never`.
syntax: glob
*.elc
*.tmp
*.orig
*.rej
*~
*.mergebackup
*.o
*.so
*.dll
*.exe
*.pyd
*.pyc
*.pyo
*$py.class
*.swp
*.prof
*.zip
\#*\#
.\#*
tests/.coverage*
tests/.testtimes*
tests/.hypothesis
tests/hypothesis-generated
tests/annotated
tests/*.err
tests/htmlcov
build
contrib/chg/chg
contrib/hgsh/hgsh
contrib/vagrant/.vagrant
contrib/docker/ubuntu-*
dist
packages
doc/common.txt
doc/*.[0-9]
doc/*.[0-9].txt
doc/*.[0-9].gendoc.txt
doc/*.[0-9].{x,ht}ml
MANIFEST
MANIFEST.in
patches
mercurial/__modulepolicy__.py
mercurial/__version__.py
mercurial/hgpythonlib.h
mercurial.egg-info
.DS_Store
tags
cscope.*
.idea/*
.asv/*
i18n/hg.pot
locale/*/LC_MESSAGES/hg.mo
hgext/__index__.py
# files installed with a local --pure build
mercurial/base85.py
mercurial/bdiff.py
mercurial/diffhelpers.py
mercurial/mpatch.py
mercurial/osutil.py
mercurial/parsers.py
syntax: regexp
^\.pc/
^\.(pydev)?project
# hackable windows distribution additions
^hg-python
^hg.py$