| 1 |
test sparse with --verbose and -T json |
| 2 |
|
| 3 |
$ hg init myrepo |
| 4 |
$ cd myrepo |
| 5 |
$ cat > .hg/hgrc <<EOF |
| 6 |
> [extensions] |
| 7 |
> sparse= |
| 8 |
> strip= |
| 9 |
> EOF |
| 10 |
|
| 11 |
$ echo a > show |
| 12 |
$ echo x > hide |
| 13 |
$ hg ci -Aqm 'initial' |
| 14 |
|
| 15 |
$ echo b > show |
| 16 |
$ echo y > hide |
| 17 |
$ echo aa > show2 |
| 18 |
$ echo xx > hide2 |
| 19 |
$ hg ci -Aqm 'two' |
| 20 |
|
| 21 |
Verify basic --include and --reset |
| 22 |
|
| 23 |
$ hg up -q 0 |
| 24 |
$ hg debugsparse --include 'hide' -Tjson |
| 25 |
[ |
| 26 |
{ |
| 27 |
"exclude_rules_added": 0, |
| 28 |
"files_added": 0, |
| 29 |
"files_conflicting": 0, |
| 30 |
"files_dropped": 1, |
| 31 |
"include_rules_added": 1, |
| 32 |
"profiles_added": 0 |
| 33 |
} |
| 34 |
] |
| 35 |
$ hg debugsparse --clear-rules |
| 36 |
$ hg debugsparse --include 'hide' --verbose |
| 37 |
removing show |
| 38 |
Profiles changed: 0 |
| 39 |
Include rules changed: 1 |
| 40 |
Exclude rules changed: 0 |
| 41 |
|
| 42 |
$ hg debugsparse --reset -Tjson |
| 43 |
[ |
| 44 |
{ |
| 45 |
"exclude_rules_added": 0, |
| 46 |
"files_added": 1, |
| 47 |
"files_conflicting": 0, |
| 48 |
"files_dropped": 0, |
| 49 |
"include_rules_added": -1, |
| 50 |
"profiles_added": 0 |
| 51 |
} |
| 52 |
] |
| 53 |
$ hg debugsparse --include 'hide' |
| 54 |
$ hg debugsparse --reset --verbose |
| 55 |
getting show |
| 56 |
Profiles changed: 0 |
| 57 |
Include rules changed: -1 |
| 58 |
Exclude rules changed: 0 |
| 59 |
|
| 60 |
Verifying that problematic files still allow us to see the deltas when forcing: |
| 61 |
|
| 62 |
$ hg debugsparse --include 'show*' |
| 63 |
$ touch hide |
| 64 |
$ hg debugsparse --delete 'show*' --force -Tjson |
| 65 |
pending changes to 'hide' |
| 66 |
[ |
| 67 |
{ |
| 68 |
"exclude_rules_added": 0, |
| 69 |
"files_added": 0, |
| 70 |
"files_conflicting": 1, |
| 71 |
"files_dropped": 0, |
| 72 |
"include_rules_added": -1, |
| 73 |
"profiles_added": 0 |
| 74 |
} |
| 75 |
] |
| 76 |
$ hg debugsparse --include 'show*' --force |
| 77 |
pending changes to 'hide' |
| 78 |
$ hg debugsparse --delete 'show*' --force --verbose |
| 79 |
pending changes to 'hide' |
| 80 |
Profiles changed: 0 |
| 81 |
Include rules changed: -1 |
| 82 |
Exclude rules changed: 0 |