tests/test-log
author Nicolas Dumazet <nicdumz.commits@gmail.com>
Sun, 15 Aug 2010 23:17:53 +0900
changeset 11899 99cafcae25d9
parent 11631 dbb98d8fbcaf
permissions -rwxr-xr-x
log: do not --follow file that is deleted and recreated later (issue732) == What == issue732 is only one example of a buggy behaviour, but there are in fact many intricated cases. For example: ( "o" contains an alive version of the tracked file, "x" does not) tip - o - o - x - o - o - x ... \ o - o - o - o - x ... \ / o - o This repository contains at least two instances of the tracked file, but when calling "hg log -f file" only the latest one (the one alive in tip) matters to us. == How == We must extract from the filelog the history of the file instance we're interested in and discard changes related to other instances of that file. We see that we're only interested in ancestors(node), and that all other nodes in the filelog should not be considered.
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
11562
efbc09fdefd8 test-log: Add test for "hg log -pf" (issue647)
Joel Rosdahl <joel@rosdahl.net>
parents: 11509
diff changeset
    34
echo % log -pf dir/b
efbc09fdefd8 test-log: Add test for "hg log -pf" (issue647)
Joel Rosdahl <joel@rosdahl.net>
parents: 11509
diff changeset
    35
hg log -pf dir/b
efbc09fdefd8 test-log: Add test for "hg log -pf" (issue647)
Joel Rosdahl <joel@rosdahl.net>
parents: 11509
diff changeset
    36
echo % log -vf dir/b
efbc09fdefd8 test-log: Add test for "hg log -pf" (issue647)
Joel Rosdahl <joel@rosdahl.net>
parents: 11509
diff changeset
    37
hg log -vf dir/b
efbc09fdefd8 test-log: Add test for "hg log -pf" (issue647)
Joel Rosdahl <joel@rosdahl.net>
parents: 11509
diff changeset
    38
10060
f780b1098efc templatekw: change {file_copies} behaviour, add {file_copies_switch}
Patrick Mezard <pmezard@gmail.com>
parents: 9421
diff changeset
    39
echo '% log copies with --copies'
10061
9e2ab10728a2 Make {file_copies} usable as a --template key
Patrick Mezard <pmezard@gmail.com>
parents: 10060
diff changeset
    40
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
    41
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
    42
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
    43
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
    44
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
    45
10776
08870cf7d388 Fix default style so 'log --copies' has a start and an end.
Greg Ward <greg-hg@gerg.ca>
parents: 10061
diff changeset
    46
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
    47
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
    48
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
    49
3383
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    50
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
    51
hg up -C 3
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    52
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
    53
echo foo > foo
c7c6f1a45348 Test case for log --copies on non-linear manifests (issue391)
Brendan Cully <brendan@kublai.com>
parents: 3197
diff changeset
    54
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
    55
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
    56
5811
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4510
diff changeset
    57
echo % log copies, execute bit set
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4510
diff changeset
    58
chmod +x e
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4510
diff changeset
    59
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
    60
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
    61
3837
7df171ea50cd Fix log regression where log -p file showed diffs for other files
Matt Mackall <mpm@selenic.com>
parents: 3718
diff changeset
    62
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
    63
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
    64
11631
dbb98d8fbcaf log: slowpath: only walk specified revision range during preparation
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11562
diff changeset
    65
echo '% log --removed file'
dbb98d8fbcaf log: slowpath: only walk specified revision range during preparation
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11562
diff changeset
    66
hg log --removed -v a
dbb98d8fbcaf log: slowpath: only walk specified revision range during preparation
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11562
diff changeset
    67
echo '% log --removed revrange file'
dbb98d8fbcaf log: slowpath: only walk specified revision range during preparation
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11562
diff changeset
    68
hg log --removed -v -r0:2 a
dbb98d8fbcaf log: slowpath: only walk specified revision range during preparation
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11562
diff changeset
    69
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    70
# log --follow tests
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    71
hg init ../follow
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    72
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
    73
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    74
echo base > base
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    75
hg ci -Ambase -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    76
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    77
echo r1 >> base
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    78
hg ci -Amr1 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    79
echo r2 >> base
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    80
hg ci -Amr2 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    81
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    82
hg up -C 1
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    83
echo b1 > b1
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    84
hg ci -Amb1 -d '1 0'
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
echo % log -f
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    87
hg log -f
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    88
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    89
hg up -C 0
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    90
echo b2 > b2
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    91
hg ci -Amb2 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    92
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    93
echo % log -f -r 1:tip
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    94
hg log -f -r 1:tip
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    95
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    96
hg up -C 3
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
    97
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
    98
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
    99
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
   100
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
   101
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   102
hg ci -mm12 -d '1 0'
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   103
4510
e0bc2c575044 Issue a warning if "-r ." is used with two working directory parents.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4180
diff changeset
   104
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
   105
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
   106
2785
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   107
echo postm >> b1
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   108
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
   109
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   110
echo % log --follow-first
e7f70588af30 Test suite for log --follow and --follow-first.
Brendan Cully <brendan@kublai.com>
parents: 2741
diff changeset
   111
hg log --follow-first
2901
9826af4841ef Test for log --prune.
Brendan Cully <brendan@kublai.com>
parents: 2785
diff changeset
   112
9826af4841ef Test for log --prune.
Brendan Cully <brendan@kublai.com>
parents: 2785
diff changeset
   113
echo % log -P 2
9826af4841ef Test for log --prune.
Brendan Cully <brendan@kublai.com>
parents: 2785
diff changeset
   114
hg log -P 2
3718
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   115
7762
fece056bf240 add --git option to commands supporting --patch (log, incoming, history, tip)
Jim Correia <jim.correia@pobox.com>
parents: 7062
diff changeset
   116
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
   117
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
   118
3718
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   119
echo '% log -r ""'
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   120
hg log -r ''
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   121
7062
efc579fdaf69 provide nicer feedback when an unknown node id is passed to a command
Sune Foldager <cryo@cyanite.org>
parents: 5811
diff changeset
   122
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
   123
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
   124
9373
b34184c046ac log: fix traceback for log -k caused by 1ef630452e0b (issue1805)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8020
diff changeset
   125
echo '% log -k r1'
b34184c046ac log: fix traceback for log -k caused by 1ef630452e0b (issue1805)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8020
diff changeset
   126
hg log -k r1
b34184c046ac log: fix traceback for log -k caused by 1ef630452e0b (issue1805)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8020
diff changeset
   127
9421
c8e4dc218aaf log: prevent negative date range from displaying entire log (issue1805)
Christian Ebert <blacktrash@gmx.net>
parents: 9373
diff changeset
   128
echo '% log -d -1'
c8e4dc218aaf log: prevent negative date range from displaying entire log (issue1805)
Christian Ebert <blacktrash@gmx.net>
parents: 9373
diff changeset
   129
hg log -d -1
c8e4dc218aaf log: prevent negative date range from displaying entire log (issue1805)
Christian Ebert <blacktrash@gmx.net>
parents: 9373
diff changeset
   130
10826
717c35d55fb3 color: colorize based on output labels instead of parsing output
Brodie Rao <brodie@bitheap.org>
parents: 10776
diff changeset
   131
echo '% log -p -l2 --color=always'
11141
df5d1d571d27 tests: force color ansi mode on Windows
Patrick Mezard <pmezard@gmail.com>
parents: 11061
diff changeset
   132
hg --config extensions.color= --config color.mode=ansi \
df5d1d571d27 tests: force color ansi mode on Windows
Patrick Mezard <pmezard@gmail.com>
parents: 11061
diff changeset
   133
    log -p -l2 --color=always
10826
717c35d55fb3 color: colorize based on output labels instead of parsing output
Brodie Rao <brodie@bitheap.org>
parents: 10776
diff changeset
   134
11061
51d0387523c6 log: add --stat for diffstat output
Yuya Nishihara <yuya@tcha.org>
parents: 10960
diff changeset
   135
echo '% log -r tip --stat'
51d0387523c6 log: add --stat for diffstat output
Yuya Nishihara <yuya@tcha.org>
parents: 10960
diff changeset
   136
hg log -r tip --stat
51d0387523c6 log: add --stat for diffstat output
Yuya Nishihara <yuya@tcha.org>
parents: 10960
diff changeset
   137
8020
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   138
cd ..
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   139
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   140
hg init usertest
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   141
cd usertest
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   142
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   143
echo a > a
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   144
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
   145
echo b > b
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   146
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
   147
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   148
hg log -u "User One <user1@example.org>"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   149
hg log -u "user1" -u "user2"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   150
hg log -u "user3"
777a9efdae2d log: fix broken multiple user search
Henrik Stuart <hg@hstuart.dk>
parents: 7762
diff changeset
   151
10957
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   152
cd ..
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   153
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   154
hg init branches
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   155
cd branches
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   156
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   157
echo a > a
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   158
hg ci -A -m "commit on default"
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   159
hg branch test
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   160
echo b > b
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   161
hg ci -A -m "commit on test"
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   162
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   163
hg up default
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   164
echo c > c
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   165
hg ci -A -m "commit on default"
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   166
hg up test
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   167
echo c > c
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   168
hg ci -A -m "commit on test"
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   169
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   170
echo '% log -b default'
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   171
hg log -b default
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   172
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   173
echo '% log -b test'
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   174
hg log -b test
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   175
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   176
echo '% log -b dummy'
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   177
hg log -b dummy
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   178
10960
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   179
echo '% log -b .'
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   180
hg log -b .
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   181
10957
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   182
echo '% log -b default -b test'
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   183
hg log -b default -b test
0d5f139b23c1 commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'
Steve Losh <steve@stevelosh.com>
parents: 10826
diff changeset
   184
10960
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   185
echo '% log -b default -b .'
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   186
hg log -b default -b .
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   187
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   188
echo '% log -b . -b test'
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   189
hg log -b . -b test
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   190
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   191
echo '% log -b 2'
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   192
hg log -b 2
ca739acf1a98 commands: add more robust support for 'hg log -b' (issue2078)
Steve Losh <steve@stevelosh.com>
parents: 10957
diff changeset
   193
11508
fbab0875fd09 log: fix missing diff output for hg log -p in sub directory
Yuya Nishihara <yuya@tcha.org>
parents: 11141
diff changeset
   194
echo '% log -p --cwd dir (in subdir)'
fbab0875fd09 log: fix missing diff output for hg log -p in sub directory
Yuya Nishihara <yuya@tcha.org>
parents: 11141
diff changeset
   195
mkdir dir
fbab0875fd09 log: fix missing diff output for hg log -p in sub directory
Yuya Nishihara <yuya@tcha.org>
parents: 11141
diff changeset
   196
hg log -p --cwd dir
fbab0875fd09 log: fix missing diff output for hg log -p in sub directory
Yuya Nishihara <yuya@tcha.org>
parents: 11141
diff changeset
   197
11509
2eaaad99f2f0 test-log: also test "log -p -R" case
Martin Geisler <mg@lazybytes.net>
parents: 11508
diff changeset
   198
echo '% log -p -R repo'
2eaaad99f2f0 test-log: also test "log -p -R" case
Martin Geisler <mg@lazybytes.net>
parents: 11508
diff changeset
   199
cd dir
2eaaad99f2f0 test-log: also test "log -p -R" case
Martin Geisler <mg@lazybytes.net>
parents: 11508
diff changeset
   200
hg log -p -R .. ../a
2eaaad99f2f0 test-log: also test "log -p -R" case
Martin Geisler <mg@lazybytes.net>
parents: 11508
diff changeset
   201
2eaaad99f2f0 test-log: also test "log -p -R" case
Martin Geisler <mg@lazybytes.net>
parents: 11508
diff changeset
   202
11899
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   203
cd ..
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   204
hg init follow2
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   205
cd follow2
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   206
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   207
# Build the following history:
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   208
# tip - o - x - o - x - x
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   209
#    \                 /
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   210
#     o - o - o - x
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   211
#      \     /
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   212
#         o
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   213
#
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   214
# Where "o" is a revision containing "foo" and
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   215
# "x" is a revision without "foo"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   216
touch init
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   217
hg ci -A -m "init, unrelated"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   218
echo 'foo' > init
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   219
hg ci -m "change, unrelated"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   220
echo 'foo' > foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   221
hg ci -A -m "add unrelated old foo"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   222
hg rm foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   223
hg ci -m "delete foo, unrelated"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   224
echo 'related' > foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   225
hg ci -A -m "add foo, related"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   226
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   227
hg up 0
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   228
touch branch
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   229
hg ci -A -m "first branch, unrelated"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   230
touch foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   231
hg ci -A -m "create foo, related"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   232
echo 'change' > foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   233
hg ci -m "change foo, related"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   234
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   235
hg up 6
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   236
echo 'change foo in branch' > foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   237
hg ci -m "change foo in branch, related"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   238
hg merge 7
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   239
echo 'merge 1' > foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   240
hg resolve -m foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   241
hg ci -m "First merge, related"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   242
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   243
hg merge 4
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   244
echo 'merge 2' > foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   245
hg resolve -m foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   246
hg ci -m "Last merge, related"
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   247
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   248
hg --config "extensions.graphlog=" glog
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   249
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   250
hg --traceback log -f foo
99cafcae25d9 log: do not --follow file that is deleted and recreated later (issue732)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11631
diff changeset
   251
3718
7db88b094b14 fix hg log -r ''
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3383
diff changeset
   252
exit 0