localrepo: refactor prepush logic
Simplifies the prepush check logic and makes it a lot more direct and
comprehensible. Instead of comparing the total local vs. remote head count, it
compares the number of new vs. removed heads.
partial backout of
1e819576e926 and add tests (
issue2131)
The tests are due to Peter Arrenbrecht
mq: use util.unlink instead of os.unlink and os.removedirs
If, on Windows, your repository and working copy are in a reparse point and you
use os.removedirs, you will remove non-empty reparse points, disabling the
reparse point. See @
fa901423ac23.
color: add support for Windows consoles
Introduces color.mode configurable with values 'auto', 'ansi', or 'win32'. Any
other value disables coloring. When 'auto' is selected, the win32 console
method will be used if the win32console Python module is detected (requires
pywin32 to be installed).