sapling/eden/scm/tests/test-template-filestat.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

68 lines
1.8 KiB
Perl

#require py2
#chg-compatible
$ newrepo
$ touch base
$ hg commit -Am A
adding base
$ echo somedata > base
$ touch other
$ hg commit -Am B
adding other
$ hg rm base
$ echo somemoredata > other
$ hg commit -m C
$ hg log --graph -T '{filestat}'
@ 2 filestats
|
o 2 filestats
|
o 1 filestat
$ hg log --graph -T '{filestat|json}'
@ [{"name": "other", "op": "M", "size": 13, "type": "n"}, {"name": "base", "op": "R", "size": 0, "type": "r"}]
|
o [{"name": "base", "op": "M", "size": 9, "type": "n"}, {"name": "other", "op": "A", "size": 0, "type": "n"}]
|
o [{"name": "base", "op": "A", "size": 0, "type": "n"}]
$ hg log -T '{filestat % "{node|short} {op} {type} {size} {name}\n"}'
bdfc298dced0 M n 13 other
bdfc298dced0 R r 0 base
7f32e4a2ca03 M n 9 base
7f32e4a2ca03 A n 0 other
ca66854ba526 A n 0 base
#if no-windows
$ chmod +x other
$ ln -s other link
$ hg commit -Am "D"
adding link
$ hg log --graph -T '{filestat}'
@ 2 filestats
|
o 2 filestats
|
o 2 filestats
|
o 1 filestat
$ hg log --graph -T '{filestat|json}'
@ [{"name": "other", "op": "M", "size": 13, "type": "x"}, {"name": "link", "op": "A", "size": 5, "type": "l"}]
|
o [{"name": "other", "op": "M", "size": 13, "type": "n"}, {"name": "base", "op": "R", "size": 0, "type": "r"}]
|
o [{"name": "base", "op": "M", "size": 9, "type": "n"}, {"name": "other", "op": "A", "size": 0, "type": "n"}]
|
o [{"name": "base", "op": "A", "size": 0, "type": "n"}]
$ hg log -T '{filestat % "{node|short} {op} {type} {size} {name}\n"}'
8c2b56d0093b M x 13 other
8c2b56d0093b A l 5 link
bdfc298dced0 M n 13 other
bdfc298dced0 R r 0 base
7f32e4a2ca03 M n 9 base
7f32e4a2ca03 A n 0 other
ca66854ba526 A n 0 base
#endif