sapling/eden/scm/tests/test-fileset-generated.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

120 lines
3.6 KiB
Perl

#require py2
#chg-compatible
$ hg init
Set up history and working copy
$ $PYTHON $TESTDIR/generateworkingcopystates.py state 2 1
$ hg addremove -q --similarity 0
$ hg commit -m first
$ $PYTHON $TESTDIR/generateworkingcopystates.py state 2 2
$ hg addremove -q --similarity 0
$ hg commit -m second
$ $PYTHON $TESTDIR/generateworkingcopystates.py state 2 wc
$ hg addremove -q --similarity 0
$ hg forget *_*_*-untracked
$ rm *_*_missing-*
Test status
$ hg st -A 'set:modified()'
M content1_content1_content3-tracked
M content1_content2_content1-tracked
M content1_content2_content3-tracked
M missing_content2_content3-tracked
$ hg st -A 'set:added()'
A content1_missing_content1-tracked
A content1_missing_content3-tracked
A missing_missing_content3-tracked
$ hg st -A 'set:removed()'
R content1_content1_content1-untracked
R content1_content1_content3-untracked
R content1_content1_missing-untracked
R content1_content2_content1-untracked
R content1_content2_content2-untracked
R content1_content2_content3-untracked
R content1_content2_missing-untracked
R missing_content2_content2-untracked
R missing_content2_content3-untracked
R missing_content2_missing-untracked
$ hg st -A 'set:deleted()'
! content1_content1_missing-tracked
! content1_content2_missing-tracked
! content1_missing_missing-tracked
! missing_content2_missing-tracked
! missing_missing_missing-tracked
$ hg st -A 'set:missing()'
! content1_content1_missing-tracked
! content1_content2_missing-tracked
! content1_missing_missing-tracked
! missing_content2_missing-tracked
! missing_missing_missing-tracked
$ hg st -A 'set:unknown()'
? content1_missing_content1-untracked
? content1_missing_content3-untracked
? missing_missing_content3-untracked
$ hg st -A 'set:clean()'
C content1_content1_content1-tracked
C content1_content2_content2-tracked
C missing_content2_content2-tracked
Test log
$ hg log -T '{rev}\n' --stat 'set:modified()'
1
content1_content2_content1-tracked | 2 +-
content1_content2_content3-tracked | 2 +-
missing_content2_content3-tracked | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
0
content1_content1_content3-tracked | 1 +
content1_content2_content1-tracked | 1 +
content1_content2_content3-tracked | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
Test revert
$ hg revert 'set:modified()'
reverting content1_content1_content3-tracked
reverting content1_content2_content1-tracked
reverting content1_content2_content3-tracked
reverting missing_content2_content3-tracked
$ hg revert 'set:added()'
forgetting content1_missing_content1-tracked
forgetting content1_missing_content3-tracked
forgetting missing_missing_content3-tracked
$ hg revert 'set:removed()'
undeleting content1_content1_content1-untracked
undeleting content1_content1_content3-untracked
undeleting content1_content1_missing-untracked
undeleting content1_content2_content1-untracked
undeleting content1_content2_content2-untracked
undeleting content1_content2_content3-untracked
undeleting content1_content2_missing-untracked
undeleting missing_content2_content2-untracked
undeleting missing_content2_content3-untracked
undeleting missing_content2_missing-untracked
$ hg revert 'set:deleted()'
reverting content1_content1_missing-tracked
reverting content1_content2_missing-tracked
forgetting content1_missing_missing-tracked
reverting missing_content2_missing-tracked
forgetting missing_missing_missing-tracked
$ hg revert 'set:unknown()'
$ hg revert 'set:clean()'