##// END OF EJS Templates
color: don't infer vt status from TERM on Windows...
color: don't infer vt status from TERM on Windows Previously, it was assumed that Windows environments with "xterm" in the TERM environment variable meant that either "virtual terminal mode" was already enabled, or that we are running in an environment that didn't need a "virtual terminal mode" (such as mintty, that interprets ANSI sequences itself). However, modern Cygwin and MSYS2 set TERM=xterm when using the Command Prompt as the terminal, which needs "virtual terminal mode" to be manually enabled. However, due to (issue6640), the vtmode wasn't being enabled. This patch ensures that we always try to enable vtmode on Windows regardless of the state of TERM, so that: * ANSI-based colors work in modern Cygwin/MSYS2 (with Command Prompt), and * The vtmode is unnecessarily set when running in a different terminal such as mintty, but it is simply redundant and doesn't appear to have ill effects. Differential Revision: https://phab.mercurial-scm.org/D12158

File last commit:

r48442:0caac68a default
r49587:fd2cf9e0 default
Show More
purge.py
39 lines | 1.7 KiB | text/x-python | PythonLexer
# Copyright (C) 2006 - Marco Barisione <marco@barisione.org>
#
# This is a small extension for Mercurial (https://mercurial-scm.org/)
# that removes files not known to mercurial
#
# This program was inspired by the "cvspurge" script contained in CVS
# utilities (http://www.red-bean.com/cvsutils/).
#
# For help on the usage of "hg purge" use:
# hg help purge
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
'''command to delete untracked files from the working directory (DEPRECATED)
The functionality of this extension has been included in core Mercurial since
version 5.7. Please use :hg:`purge ...` instead. :hg:`purge --confirm` is now
the default, unless the extension is enabled for backward compatibility.
'''
# This empty extension looks pointless, but core mercurial checks if it's loaded
# to implement the slightly different behavior documented above.
# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
# be specifying the version(s) of Mercurial they are tested with, or
# leave the attribute unspecified.
testedwith = b'ships-with-hg-core'