sapling/eden/scm/tests/test-sparse-extensions.t
Durham Goode 0753e33866 status: show tracked-but-ignored files during status
Summary:
Creates a manifest matcher and uses it to unignore files that are
in the parent manifest but are match the ignore patterns.

This covers modified and removed files (i.e. files that have changes and are in
p1). It does not cover added files, which will be handled in the next diff.

Differential Revision: D39481483

fbshipit-source-id: e0aaf14c706f8c203bb2737321eb831b54b0a330
2022-09-16 11:56:50 -07:00

60 lines
1.4 KiB
Perl

#debugruntest-compatible
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
$ setconfig workingcopy.ruststatus=False
# test sparse interaction with other extensions
$ hg init myrepo
$ cd myrepo
$ cat > .hg/hgrc << 'EOF'
> [extensions]
> sparse=
> # Remove once default-on:
> simplecache=
> [simplecache]
> showdebug=true
> EOF
# Test integration with simplecache for profile reads
$ printf '[include]\nfoo\n.gitignore\n' > .hgsparse
$ hg add .hgsparse
$ hg commit -qm 'Add profile'
$ hg sparse --enable-profile .hgsparse
#if fsmonitor
# Test fsmonitor integration (if available)
$ touch .watchmanconfig
$ echo ignoredir1 >> .gitignore
$ hg commit -Am ignoredir1
adding .gitignore
$ echo ignoredir2 >> .gitignore
$ hg commit -m ignoredir2
$ hg sparse reset
$ hg sparse -I ignoredir1 -I ignoredir2 -I dir1 -I .gitignore
$ mkdir ignoredir1 ignoredir2 dir1
$ touch ignoredir1/file ignoredir2/file dir1/file
# Run status twice to compensate for a condition in fsmonitor where it will check
# ignored files the second time it runs, regardless of previous state (ask @sid0)
$ hg status
? dir1/file
$ hg status
? dir1/file
# Test that fsmonitor by default handles .gitignore changes and can "unignore" files.
$ hg up -q '.^'
$ hg status
? dir1/file
? ignoredir2/file
#endif