tests/test-log
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 14 Apr 2010 09:08:47 +0200
branchstable
changeset 10902 4eb6311d217a
parent 10776 08870cf7d388
child 10826 717c35d55fb3
permissions -rwxr-xr-x
run-tests.py: reset env variables set by hooks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2741
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
hg init a
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     4
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
cd a
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     6
echo a > a
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     7
hg ci -Ama -d '1 0'
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     8
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
hg cp a b
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    10
hg ci -mb -d '2 0'
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    12
mkdir dir
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
hg mv b dir
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
hg ci -mc -d '3 0'
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
hg mv a b
3837
7df171ea50cd Fix log regression where log -p file showed diffs for other files
Matt Mackall <mpm@selenic.com>
parents: 3718
diff changeset
    17
echo a > d
7df171ea50cd Fix log regression where log -p file showed diffs for other files
Matt Mackall <mpm@selenic.com>
parents: 3718
diff changeset
    18
hg add d
2741
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    19
hg ci -md -d '4 0'
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    20
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    21
hg mv dir/b e
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    22
hg ci -me -d '5 0'
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    24
hg log a
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    25
echo % -f, directory
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    26
hg log -f dir
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    27
echo % -f, but no args
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    28
hg log -f
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    29
echo % one rename
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    30
hg log -vf a
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    31
echo % many renames
ae5ce3454ef5 log: add -f/--follow option, to follow rename/copy
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    32
hg log -vf e
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    33
10060
f780b1098efc templatekw: change {file_copies} behaviour, add {file_copies_switch}
Patrick Mezard <pmezard@gmail.com>
parents: 9421
diff changeset
    34
echo '% log copies with --copies'
10061
9e2ab10728a2 Make {file_copies} usable as a --template key
Patrick Mezard <pmezard@gmail.com>
parents: 10060
diff changeset
    35
hg log -vC --template '{rev} {file_copies}\n'
9e2ab10728a2 Make {file_copies} usable as a --template key
Patrick Mezard <pmezard@gmail.com>
parents: 10060
diff changeset
    36
echo '% log copies switch without --copies, with old filecopy template'
10060
f780b1098efc templatekw: change {file_copies} behaviour, add {file_copies_switch}
Patrick Mezard <pmezard@gmail.com>
parents: 9421
diff changeset
    37
hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
f780b1098efc templatekw: change {file_copies} behaviour, add {file_copies_switch}
Patrick Mezard <pmezard@gmail.com>
parents: 9421
diff changeset
    38
echo '% log copies switch with --copies'
10061
9e2ab10728a2 Make {file_copies} usable as a --template key
Patrick Mezard <pmezard@gmail.com>
parents: 10060
diff changeset
    39
hg log -vC --template '{rev} {file_copies_switch}\n'
3197
e18c3d08528d Show copies in hg log.
Brendan Cully <brendan@kublai.com>
parents: 2901
diff changeset
    40
10776
08870cf7d388 Fix default style so 'log --copies' has a start and an end.
Greg Ward <greg-hg@gerg.ca>
parents: 10061
diff changeset
    41
echo '% log copies with hardcoded style and with --style=default'
08870cf7d388 Fix default style so 'log --copies' has a start and an end.
Greg Ward <greg-hg@gerg.ca>
parents: 10061
diff changeset
    42
hg log -vC -r4
08870cf7d388 Fix default style so 'log --copies' has a start and an end.
Greg Ward <greg-hg@gerg.ca>
parents: 10061
diff changeset
    43
hg log -vC -r4 --style=default
08870cf7d388 Fix default style so 'log --copies' has a start and an end.
Greg Ward <greg-hg@gerg.ca>
parents: 10061
diff changeset
    44
3383
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    45
echo % log copies, non-linear manifest
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    46
hg up -C 3
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    47
hg mv dir/b e
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    48
echo foo > foo
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    49
hg ci -Ame2 -d '6 0'
10061
9e2ab10728a2 Make {file_copies} usable as a --template key
Patrick Mezard <pmezard@gmail.com>
parents: 10060
diff changeset
    50
hg log -v --template '{rev} {file_copies}\n' -r 5
3383
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    51
5811
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4510
diff changeset
    52
echo % log copies, execute bit set
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4510
diff changeset
    53
chmod +x e
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4510
diff changeset
    54
hg ci -me3 -d '7 0'
10061
9e2ab10728a2 Make {file_copies} usable as a --template key
Patrick Mezard <pmezard@gmail.com>
parents: 10060
diff changeset
    55
hg log -v --template '{rev} {file_copies}\n' -r 6
5811
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4510
diff changeset
    56
3837
7df171ea50cd Fix log regression where log -p file showed diffs for other files
Matt Mackall <mpm@selenic.com>
parents: 3718
diff changeset
    57
echo '% log -p d'
7df171ea50cd Fix log regression where log -p file showed diffs for other files
Matt Mackall <mpm@selenic.com>
parents: 3718
diff changeset
    58
hg log -pv d
7df171ea50cd Fix log regression where log -p file showed diffs for other files
Matt Mackall <mpm@selenic.com>
parents: 3718
diff changeset
    59
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    60
# log --follow tests
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    61
hg init ../follow
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    62
cd ../follow
4510
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    63
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    64
echo base > base
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    65
hg ci -Ambase -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    66
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    67
echo r1 >> base
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    68
hg ci -Amr1 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    69
echo r2 >> base
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    70
hg ci -Amr2 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    71
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    72
hg up -C 1
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    73
echo b1 > b1
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    74
hg ci -Amb1 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    75
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    76
echo % log -f
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    77
hg log -f
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    78
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    79
hg up -C 0
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    80
echo b2 > b2
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    81
hg ci -Amb2 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    82
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    83
echo % log -f -r 1:tip
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    84
hg log -f -r 1:tip
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    85
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    86
hg up -C 3
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    87
hg merge tip
4510
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    88
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    89
echo % log -r .  with two parents
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    90
hg log -r .
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    91
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    92
hg ci -mm12 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    93
4510
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    94
echo % log -r .  with one parent
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    95
hg log -r .
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    96
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    97
echo postm >> b1
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    98
hg ci -Amb1.1 -d'1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    99
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   100
echo % log --follow-first
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   101
hg log --follow-first
2901
9826af4841ef Test for log --prune.
Brendan Cully <brendan@kublai.com>
parents: 2785
diff changeset
   102
9826af4841ef Test for log --prune.
Brendan Cully <brendan@kublai.com>
parents: 2785
diff changeset
   103
echo % log -P 2
9826af4841ef Test for log --prune.
Brendan Cully <brendan@kublai.com>
parents: 2785
diff changeset
   104
hg log -P 2
3718
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   105
7762
fece056bf240 add --git option to commands supporting --patch (log, incoming, history, tip)
Jim Correia <jim.correia@pobox.com>
parents: 7062
diff changeset
   106
echo '% log -r tip -p --git'
fece056bf240 add --git option to commands supporting --patch (log, incoming, history, tip)
Jim Correia <jim.correia@pobox.com>
parents: 7062
diff changeset
   107
hg log -r tip -p --git
fece056bf240 add --git option to commands supporting --patch (log, incoming, history, tip)
Jim Correia <jim.correia@pobox.com>
parents: 7062
diff changeset
   108
3718
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   109
echo '% log -r ""'
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   110
hg log -r ''
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   111
7062
efc579fdaf69 provide nicer feedback when an unknown node id is passed to a command
Sune Foldager <cryo@cyanite.org>
parents: 5811
diff changeset
   112
echo '% log -r <some unknown node id>'
efc579fdaf69 provide nicer feedback when an unknown node id is passed to a command
Sune Foldager <cryo@cyanite.org>
parents: 5811
diff changeset
   113
hg log -r 1000000000000000000000000000000000000000
efc579fdaf69 provide nicer feedback when an unknown node id is passed to a command
Sune Foldager <cryo@cyanite.org>
parents: 5811
diff changeset
   114
9373
b34184c046ac log: fix traceback for log -k caused by 1ef630452e0b (issue1805)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8020
diff changeset
   115
echo '% log -k r1'
b34184c046ac log: fix traceback for log -k caused by 1ef630452e0b (issue1805)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8020
diff changeset
   116
hg log -k r1
b34184c046ac log: fix traceback for log -k caused by 1ef630452e0b (issue1805)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8020
diff changeset
   117
9421
c8e4dc218aaf log: prevent negative date range from displaying entire log (issue1805)
Christian Ebert <blacktrash@gmx.net>
parents: 9373
diff changeset
   118
echo '% log -d -1'
c8e4dc218aaf log: prevent negative date range from displaying entire log (issue1805)
Christian Ebert <blacktrash@gmx.net>
parents: 9373
diff changeset
   119
hg log -d -1
c8e4dc218aaf log: prevent negative date range from displaying entire log (issue1805)
Christian Ebert <blacktrash@gmx.net>
parents: 9373
diff changeset
   120
8020
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   121
cd ..
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   122
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   123
hg init usertest
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   124
cd usertest
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   125
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   126
echo a > a
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   127
hg ci -A -m "a" -u "User One <user1@example.org>"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   128
echo b > b
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   129
hg ci -A -m "b" -u "User Two <user2@example.org>"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   130
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   131
hg log -u "User One <user1@example.org>"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   132
hg log -u "user1" -u "user2"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   133
hg log -u "user3"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   134
3718
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   135
exit 0