sapling/tests/test-sparse-verbose-json.t
Kostia Balytskyi 650abf4b9e tests: stop importing sparse from an explicit python file
Summary:
Importing anything from python files with explicit breaks embedded
aproach we use on Windows.

For one of the tests, I did add `hg debugshell -c "from hgext import sparse;
print sparse.__file__` just to make sure the same file is used in practice.

Reviewed By: singhsrb

Differential Revision: D13258984

fbshipit-source-id: 4c86e1dccfd4f525a14019dc4b9586d798f2bffe
2018-11-30 02:19:16 -08:00

93 lines
2.0 KiB
Perl

test sparse with --verbose and -T json
$ hg init myrepo
$ cd myrepo
$ cat > .hg/hgrc <<EOF
> [extensions]
> sparse=
> 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
calculating actions for refresh
applying changes to disk (1 actions)
removing show
updating dirstate
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
calculating actions for refresh
applying changes to disk (1 actions)
getting show
updating dirstate
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
calculating actions for refresh
verifying no pending changes in newly included files
pending changes to 'hide'
applying changes to disk (1 actions)
updating dirstate
Profile # change: 0
Include rule # change: -1
Exclude rule # change: 0