sapling/fb-hgext/tests/test-fb-hgext-sparse-verbose-json.t
Kostia Balytskyi 51b54621e7 fb-hgext: rename all the tests to be of test-fb-hgext-smth pattern
Summary:
For the purposes of easier identification of tests which came from fb-hgext,
let's rename them all, even the ones for remotefilelog and so on. Once everything
is in hg-crew properly, we can rename things to not be named like this.

Depends on D6675292

Test Plan: - just a rename

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675309
2018-01-08 10:34:11 -08:00

83 lines
1.7 KiB
Perl

test sparse with --verbose and -T json
$ hg init myrepo
$ cd myrepo
$ cat > .hg/hgrc <<EOF
> [extensions]
> sparse=$TESTDIR/../hgext3rd/fbsparse.py
> strip=
> EOF
$ echo a > show
$ echo x > hide
$ hg ci -Aqm 'initial'
$ echo b > show
$ echo y > hide
$ echo aa > show2
$ echo xx > hide2
$ hg ci -Aqm 'two'
Verify basic --include and --reset
$ hg up -q 0
$ hg sparse --include 'hide' -Tjson
[
{
"exclude_rules_added": 0,
"files_added": 0,
"files_conflicting": 0,
"files_dropped": 1,
"include_rules_added": 1,
"profiles_added": 0
}
]
$ hg sparse --clear-rules
$ hg sparse --include 'hide' --verbose
removing show
Profile # change: 0
Include rule # change: 1
Exclude rule # change: 0
$ hg sparse --reset -Tjson
[
{
"exclude_rules_added": 0,
"files_added": 1,
"files_conflicting": 0,
"files_dropped": 0,
"include_rules_added": -1,
"profiles_added": 0
}
]
$ hg sparse --include 'hide'
$ hg sparse --reset --verbose
getting show
Profile # change: 0
Include rule # change: -1
Exclude rule # change: 0
Verifying that problematic files still allow us to see the deltas when forcing:
$ hg sparse --include 'show*'
$ touch hide
$ hg sparse --delete 'show*' --force -Tjson
pending changes to 'hide'
[
{
"exclude_rules_added": 0,
"files_added": 0,
"files_conflicting": 1,
"files_dropped": 0,
"include_rules_added": -1,
"profiles_added": 0
}
]
$ hg sparse --include 'show*' --force
pending changes to 'hide'
$ hg sparse --delete 'show*' --force --verbose
pending changes to 'hide'
Profile # change: 0
Include rule # change: -1
Exclude rule # change: 0