sapling/eden/scm/tests/test-update-over-sparse-profile-change.t
Durham Goode 93ae8ba357 sparse: fix xoring of None
Summary:
We got a [report](https://fb.workplace.com/groups/scm/permalink/3379140858802177/) that a new hg build fails with an error because it can't xor None types.

```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PyErr {
ptype: <type 'exceptions.TypeError'>, pvalue: Some("unsupported operand type(s)
for ^: 'NoneType' and 'NoneType'"), ptraceback: Some(<traceback object at
0x00000249BB158248>) }',
```

Full stack trace is here
{P149395441}

This seems likely to be related to the diff I landed recently - D24725902 (7b1798be37).
However it's unclear why it was affecting only windows because I couldn't repro
it on linux.

Turned out that we have experimental.treematcher option disabled on windows,
which causes it to use includematcher instead of treematcher. And includematcher
returns either None or BytesMatchObject and they are impossible to xor.

This diff fixes it by converting them value to bool first, and also it adds a
test for it.

Reviewed By: singhsrb

Differential Revision: D24918192

fbshipit-source-id: 1359e8b97d26d3b1a4795b7b3d4cfa3d6d4ae843
2020-11-12 17:34:07 -08:00

42 lines
653 B
Perl

#chg-compatible
#testcases treematcher non-treematcher
test sparse
$ enable sparse
$ hg init myrepo
$ cd myrepo
#if treematcher
$ cat >> .hg/hgrc <<EOF
> [experimental]
> treematcher = False
> EOF
#endif
$ echo a > show
$ echo a > show2
$ echo x > hide
$ cat >> .sparse-include <<EOF
> [include]
> show
> .sparse-include
> EOF
$ hg add .sparse-include
$ hg ci -Aqm 'initial'
$ hg sparse enable .sparse-include
$ ls
show
$ cat >> .sparse-include <<EOF
> [include]
> show
> show2
> EOF
$ hg ci -Am 'second'
$ hg up -q 'desc(initial)'
$ ls
show
$ hg up -q 'desc(second)'
$ ls
show
show2