sapling/eden/scm/tests/test-fb-hgext-treemanifest-sendtrees.t
Zeyi (Rice) Fan 92f6f35e7a mark all tests requiring Python 2
Summary:
This diff marks **ALL** mercurial tests requiring Python 2 feature.

After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed.

To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example:

```
HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests
```

or

```
HGTEST_FORCE_PY2=1 python run-tests.py
```

----

Basically this diff are created with the following commands:

```
$ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py
$ sed -i '1s/^/#require py2\n/' test-*.t
$ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list)
# manually adding feature requires for these Python tests.
```

(Note: this ignores all push blocking failures!)

ignore-conflict-markers

Reviewed By: singhsrb

Differential Revision: D19655148

fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
2020-01-30 18:49:21 -08:00

92 lines
2.5 KiB
Raku

#require py2
#chg-compatible
$ . "$TESTDIR/library.sh"
$ cat >> $HGRCPATH <<EOF
> [extensions]
> pushrebase=
> remotenames=
> [treemanifest]
> sendtrees=True
> EOF
Setup the server
$ hginit master
$ cd master
$ cat >> .hg/hgrc <<EOF
> [treemanifest]
> server=True
> [remotefilelog]
> server=True
> shallowtrees=True
> EOF
Make local commits on the server
$ mkdir subdir
$ echo x > subdir/x
$ hg commit -qAm 'add subdir/x'
$ hg book master
The following will turn on sendtrees mode for a hybrid client and verify it
sends them during a push and during bundle operations.
Create flat manifest clients
$ cd ..
$ hgcloneshallow ssh://user@dummy/master client1 -q
fetching tree '' 85b359fdb09e9b8d7ac4a74551612b277345e8fd
2 trees fetched over * (glob)
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
$ hgcloneshallow ssh://user@dummy/master client2 -q
Transition to hybrid flat+tree client
$ cat >> client1/.hg/hgrc <<EOF
> [extensions]
> amend=
> [treemanifest]
> demanddownload=True
> EOF
$ cat >> client2/.hg/hgrc <<EOF
> [extensions]
> amend=
> [treemanifest]
> demanddownload=True
> EOF
Make a draft commit
$ cd client1
$ echo f >> subdir/x
$ hg commit -qm "hybrid commit"
$ hg debugdatapack .hg/store/packs/manifests/*datapack
.hg/store/packs/manifests/5395c3a9f408d2f2ffac93a2f1d6f039234be6ff:
subdir:
Node Delta Base Delta Length Blob Size
97c1b2747888 000000000000 43 (missing)
(empty name):
Node Delta Base Delta Length Blob Size
c0196aba344d 000000000000 49 (missing)
Test bundling/unbundling
$ hg bundle -r . --base '.^' ../treebundle.hg --debug | grep treegroup
bundle2-output-part: "b2x:treegroup2" (params: 3 mandatory) streamed payload
$ cd ../client2
$ hg unbundle ../treebundle.hg --debug | grep treegroup
bundle2-input-part: "b2x:treegroup2" (params: 3 mandatory) supported
$ hg debugdatapack .hg/store/packs/manifests/*datapack
.hg/store/packs/manifests/5395c3a9f408d2f2ffac93a2f1d6f039234be6ff:
subdir:
Node Delta Base Delta Length Blob Size
97c1b2747888 000000000000 43 (missing)
(empty name):
Node Delta Base Delta Length Blob Size
c0196aba344d 000000000000 49 (missing)
Test pushing
$ hg push -r tip --to master --debug 2>&1 | grep rebasepackpart
bundle2-output-part: "b2x:rebasepackpart" (params: 3 mandatory) streamed payload