##// 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:

r45218:5c2a4f37 default
r49587:fd2cf9e0 default
Show More
test-sparse-clear.t
80 lines | 1.2 KiB | text/troff | Tads3Lexer
test sparse
$ hg init myrepo
$ cd myrepo
$ cat >> $HGRCPATH <<EOF
> [extensions]
> sparse=
> purge=
> strip=
> rebase=
> EOF
$ echo a > index.html
$ echo x > data.py
$ echo z > readme.txt
$ cat > base.sparse <<EOF
> [include]
> *.sparse
> EOF
$ hg ci -Aqm 'initial'
$ cat > webpage.sparse <<EOF
> %include base.sparse
> [include]
> *.html
> EOF
$ hg ci -Aqm 'initial'
Clear rules when there are includes
$ hg debugsparse --include *.py
$ ls -A
.hg
data.py
$ hg debugsparse --clear-rules
$ ls -A
.hg
base.sparse
data.py
index.html
readme.txt
webpage.sparse
Clear rules when there are excludes
$ hg debugsparse --exclude *.sparse
$ ls -A
.hg
data.py
index.html
readme.txt
$ hg debugsparse --clear-rules
$ ls -A
.hg
base.sparse
data.py
index.html
readme.txt
webpage.sparse
Clearing rules should not alter profiles
$ hg debugsparse --enable-profile webpage.sparse
$ ls -A
.hg
base.sparse
index.html
webpage.sparse
$ hg debugsparse --include *.py
$ ls -A
.hg
base.sparse
data.py
index.html
webpage.sparse
$ hg debugsparse --clear-rules
$ ls -A
.hg
base.sparse
index.html
webpage.sparse