sapling/eden/hg-server/tests/test-progress-classicrenderer.t
Durham Goode 98d9269874 server: copy hg to a new hg-server directory
Summary:
Create a fork of the Mercurial code that we can use to build server
rpms. The hg servers will continue to exist for a few more months while we move
the darkstorm and ediscovery use cases off them. In the mean time, we want to
start making breaking changes to the client, so let's create a stable copy of
the hg code to produce rpms for the hg servers.

The fork is based off c7770c78d, the latest hg release.

This copies the files as is, then adds some minor tweaks to get it to build:
- Disables some lint checks that appear to be bypassed by path
- sed replace eden/scm with eden/hg-server
- Removed a dependency on scm/telemetry from the edenfs-client tests since
  scm/telemetry pulls in the original eden/scm/lib/configparser which conflicts
  with the hg-server conflict parser.

allow-large-files

Reviewed By: quark-zju

Differential Revision: D27632557

fbshipit-source-id: b2f442f4ec000ea08e4d62de068750832198e1f4
2021-04-09 10:09:06 -07:00

351 lines
18 KiB
Perl

#chg-compatible
$ enable progress
$ setconfig extensions.progresstest="$TESTDIR/progresstest.py"
$ setconfig progress.delay=0 progress.changedelay=2 progress.refresh=1 progress.assume-tty=true
simple test
$ hg progresstest 4 4
progress test [============> ] 1/4 04s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 2/4 03s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 3/4 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 4/4 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
no progress with --quiet
$ hg progresstest --quiet 4 4
test nested short-lived topics (which shouldn't display with changedelay)
$ hg progresstest --nested 4 4
progress test [ ] 0/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [ ] 0/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [ ] 0/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 1/4 13s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 1/4 16s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 1/4 19s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 1/4 22s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 2/4 09s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 2/4 10s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 2/4 11s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 2/4 12s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 3/4 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 3/4 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 3/4 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 3/4 06s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 4/4 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 4/4 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 4/4 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 4/4 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test nested long-lived topics
$ hg progresstest --nested 8 8
progress test [ ] 0/8\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [ ] 0/8\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [ ] 0/8\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=====> ] 1/8 29s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=====> ] 1/8 36s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=====> ] 1/8 43s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=====> ] 1/8 50s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 2/8 25s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 2/8 28s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 2/8 31s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 2/8 34s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===================> ] 3/8 21s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===================> ] 3/8 22s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===================> ] 3/8 24s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===================> ] 3/8 26s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 4/8 17s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 4/8 18s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 4/8 19s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 4/8 20s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=================================> ] 5/8 12s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=================================> ] 5/8 12s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=================================> ] 5/8 12s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=================================> ] 5/8 15s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [==============================> ] 3/5 03s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================================> ] 4/5 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 5/5 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 6/8 10s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 6/8 10s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 6/8 10s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 6/8 10s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===============================================> ] 7/8 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===============================================> ] 7/8 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===============================================> ] 7/8 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===============================================> ] 7/8 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 8/8 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 8/8 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 8/8 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 8/8 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test nested shortlived topics without changedelay
$ hg progresstest --nested --config progress.changedelay=0 8 8
progress test [ ] 0/8\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=====> ] 1/8 29s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=====> ] 1/8 36s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 2/8 25s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [============> ] 2/8 28s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===================> ] 3/8 21s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===================> ] 3/8 22s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 4/8 17s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 4/8 18s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=================================> ] 5/8 12s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [=================================> ] 5/8 12s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========> ] 1/5 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================> ] 2/5 04s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [==============================> ] 3/5 03s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================================> ] 4/5 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 5/5 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 6/8 10s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 6/8 10s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===============================================> ] 7/8 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [===============================================> ] 7/8 05s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 8/8 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 8/8 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [=========================> ] 1/2 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jnested progress [====================================================>] 2/2 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test format options
$ hg progresstest --config progress.format='number item-3 bar' 4 4
1/4 p 1 [================> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J2/4 p 2 [=================================> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J3/4 p 3 [==================================================> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J4/4 p 4 [====================================================================>]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test format options and indeterminate progress
$ hg progresstest --config progress.format='number item bar' -- 4 -1
1 loop 1 [ <=> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J2 loop 2 [ <=> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J3 loop 3 [ <=> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J4 loop 4 [ <=> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test count over total
$ hg progresstest 6 4
progress test [============> ] 1/4 04s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [==========================> ] 2/4 03s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [========================================> ] 3/4 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [======================================================>] 4/4 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [ <=> ] 5/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jprogress test [ <=> ] 6/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test rendering with bytes
$ hg bytesprogresstest
bytes progress test [ ] 10 bytes/1.03 GB 3y28w\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [ ] 250 bytes/1.03 GB 14w05d\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [ ] 999 bytes/1.03 GB 5w04d\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [ ] 1000 bytes/1.03 GB 7w03d\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [ ] 1.00 KB/1.03 GB 9w00d\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [ ] 21.5 KB/1.03 GB 3d13h\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [ ] 1.00 MB/1.03 GB 2h04m\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [ ] 1.41 MB/1.03 GB 1h41m\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [==> ] 118 MB/1.03 GB 1m13s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [=================> ] 530 MB/1.03 GB 11s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [================================> ] 954 MB/1.03 GB 02s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jbytes progress test [====================================>] 1.03 GB/1.03 GB 01s\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test immediate completion
$ hg progresstest 0 0
test unicode topic
$ hg --encoding utf-8 progresstest 4 4 --unicode --config progress.format='topic number'
あいうえ 1/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ 2/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ 3/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ 4/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test line trimming when progress topic contains multi-byte characters
$ hg --encoding utf-8 progresstest 4 4 --unicode --config progress.width=12 --config progress.format='topic number'
あいうえ 1/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ 2/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ 3/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ 4/4\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test calculation of bar width when progress topic contains multi-byte characters
$ hg --encoding utf-8 progresstest 4 4 --unicode --config progress.width=21 --config progress.format='topic bar'
あいうえ [=> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ [===> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ [=====> ]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいうえ [========>]\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
test trimming progress items with they contain multi-byte characters
$ hg --encoding utf-8 progresstest 4 4 --unicode --config progress.format='item+6'
あいう\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいう\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあい\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいう\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)
$ hg --encoding utf-8 progresstest 4 4 --unicode --config progress.format='item-6'
あいう\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jいうえ\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあい\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[Jあいう\r (no-eol) (esc)
\r (no-eol) (esc)
\x1b[J (no-eol) (esc)