2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable stat
|
2017-07-31 21:09:50 +03:00
|
|
|
|
|
|
|
Setup repo
|
|
|
|
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
Test template stat
|
|
|
|
|
2018-05-25 10:38:08 +03:00
|
|
|
$ hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
|
|
|
|
$ $PYTHON $TESTDIR/seq.py 50 > a
|
|
|
|
$ hg add a
|
|
|
|
$ $PYTHON $TESTDIR/seq.py 26 75 > b
|
|
|
|
$ hg add b
|
|
|
|
$ hg commit -m "Added a and b with 50 lines each"
|
2018-05-25 10:38:08 +03:00
|
|
|
$ hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
a | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
b | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
2 files changed, 100 insertions(+), 0 deletions(-)
|
|
|
|
|
2018-05-25 10:38:08 +03:00
|
|
|
$ COLUMNS=20 hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
a | 50 +++++++++++
|
|
|
|
b | 50 +++++++++++
|
|
|
|
2 files changed, 100 insertions(+), 0 deletions(-)
|
|
|
|
|
|
|
|
$ $PYTHON $TESTDIR/seq.py 50 > b
|
|
|
|
$ $PYTHON $TESTDIR/seq.py 26 75 > a
|
|
|
|
$ hg commit -m "Swapped the files"
|
2018-05-25 10:38:08 +03:00
|
|
|
$ hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
a | 50 +++++++++++++++++++++++++-------------------------
|
|
|
|
b | 50 +++++++++++++++++++++++++-------------------------
|
|
|
|
2 files changed, 50 insertions(+), 50 deletions(-)
|
|
|
|
|
2018-05-25 10:38:08 +03:00
|
|
|
$ COLUMNS=20 hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
a | 50 +++++-----
|
|
|
|
b | 50 +++++-----
|
|
|
|
2 files changed, 50 insertions(+), 50 deletions(-)
|
|
|
|
|
|
|
|
$ mkdir dir
|
|
|
|
$ $PYTHON $TESTDIR/seq.py 50 > dir/a
|
|
|
|
$ hg add dir/a
|
|
|
|
$ hg commit -m "Added file with 50 lines inside directory dir"
|
2018-05-25 10:38:08 +03:00
|
|
|
$ hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
dir/a | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
1 files changed, 50 insertions(+), 0 deletions(-)
|
|
|
|
|
2018-05-25 10:38:08 +03:00
|
|
|
$ COLUMNS=20 hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
dir/a | 50 ++++++++++
|
|
|
|
1 files changed, 50 insertions(+), 0 deletions(-)
|
|
|
|
|
|
|
|
$ $PYTHON $TESTDIR/seq.py 41 60 > dir/a
|
|
|
|
$ hg commit -m "Modified file inside directory dir"
|
2018-05-25 10:38:08 +03:00
|
|
|
$ hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
dir/a | 50 ++++++++++----------------------------------------
|
|
|
|
1 files changed, 10 insertions(+), 40 deletions(-)
|
|
|
|
|
2018-05-25 10:38:08 +03:00
|
|
|
$ COLUMNS=20 hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
dir/a | 50 ++--------
|
|
|
|
1 files changed, 10 insertions(+), 40 deletions(-)
|
|
|
|
|
|
|
|
$ $PYTHON << EOF
|
|
|
|
> with open('binary', 'wb') as f:
|
|
|
|
> f.write(b'\x00\x01\x02\x00' * 10)
|
|
|
|
> EOF
|
|
|
|
$ hg add binary
|
|
|
|
$ hg commit -m "Added binary file"
|
2018-05-25 10:38:08 +03:00
|
|
|
$ hg log -r . -T '{stat()}'
|
2017-07-31 21:09:50 +03:00
|
|
|
binary | Bin
|
|
|
|
1 files changed, 0 insertions(+), 0 deletions(-)
|
2018-05-25 10:38:13 +03:00
|
|
|
$ hg log -r . -T '{stat("status")}'
|
|
|
|
added binary | Bin
|
|
|
|
1 files changed, 0 insertions(+), 0 deletions(-)
|
|
|
|
|
|
|
|
$ hg rm -q binary a
|
|
|
|
$ echo 3 >> b
|
|
|
|
$ echo 4 >> c
|
|
|
|
$ hg add c
|
|
|
|
$ hg log -r 'wdir()' -T '{stat(status)}'
|
|
|
|
removed a | 50 --------------------------------------------------
|
|
|
|
changed b | 1 +
|
|
|
|
removed binary | Bin
|
|
|
|
added c | 1 +
|
|
|
|
4 files changed, 2 insertions(+), 50 deletions(-)
|