tests/test-grep.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 08 Mar 2024 15:06:54 +0100
changeset 51486 0ddc34330d41
parent 51364 c6560ee526d2
permissions -rw-r--r--
branchcache: do not accept "empty update" This currently does not happens and it will be simpler that is remains that way. If all update do something, we will be able to simply declare, in a later changesets, that all update to result in a dirty branchcache.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13920
diff changeset
     1
  $ hg init t
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     2
  $ cd t
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     3
  $ echo import > port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     4
  $ hg add port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     5
  $ hg commit -m 0 -u spam -d '0 0'
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     6
  $ echo export >> port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     7
  $ hg commit -m 1 -u eggs -d '1 0'
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     8
  $ echo export > port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
     9
  $ echo vaportight >> port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    10
  $ echo 'import/export' >> port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    11
  $ hg commit -m 2 -u spam -d '2 0'
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    12
  $ echo 'import/export' >> port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    13
  $ hg commit -m 3 -u eggs -d '3 0'
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    14
  $ head -n 3 port > port1
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    15
  $ mv port1 port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    16
  $ hg commit -m 4 -u spam -d '4 0'
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    17
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    18
pattern error
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    19
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    20
  $ hg grep '**test**'
39044
83cee1af747f tests: allow more detailed error message from re.compile
Augie Fackler <augie@google.com>
parents: 38960
diff changeset
    21
  grep: invalid match pattern: nothing to repeat* (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11902
diff changeset
    22
  [1]
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    23
45725
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
    24
invalid revset syntax
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
    25
45750
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
    26
  $ hg log -r 'diffcontains()'
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
    27
  hg: parse error: diffcontains takes at least 1 argument
45895
fc4fb2f17dd4 errors: use exit code 10 for parse errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
    28
  [10]
45750
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
    29
  $ hg log -r 'diffcontains(:)'
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
    30
  hg: parse error: diffcontains requires a string pattern
45895
fc4fb2f17dd4 errors: use exit code 10 for parse errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
    31
  [10]
45750
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
    32
  $ hg log -r 'diffcontains("re:**test**")'
45725
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
    33
  hg: parse error: invalid regular expression: nothing to repeat* (glob)
45895
fc4fb2f17dd4 errors: use exit code 10 for parse errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
    34
  [10]
45725
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
    35
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    36
simple
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    37
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
    38
  $ hg grep -r tip:0 '.*'
17923
1e6b5faf9d4e grep: don't search past the end of the searched string
Idan Kamara <idankk86@gmail.com>
parents: 17806
diff changeset
    39
  port:4:export
1e6b5faf9d4e grep: don't search past the end of the searched string
Idan Kamara <idankk86@gmail.com>
parents: 17806
diff changeset
    40
  port:4:vaportight
1e6b5faf9d4e grep: don't search past the end of the searched string
Idan Kamara <idankk86@gmail.com>
parents: 17806
diff changeset
    41
  port:4:import/export
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    42
  port:3:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    43
  port:3:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    44
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    45
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    46
  port:2:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    47
  port:2:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    48
  port:2:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    49
  port:1:import
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    50
  port:1:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    51
  port:0:import
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
    52
  $ hg grep -r tip:0 port port
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    53
  port:4:export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    54
  port:4:vaportight
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    55
  port:4:import/export
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    56
  port:3:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    57
  port:3:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    58
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    59
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    60
  port:2:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    61
  port:2:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    62
  port:2:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    63
  port:1:import
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    64
  port:1:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    65
  port:0:import
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
    66
41513
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    67
simple from subdirectory
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    68
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    69
  $ mkdir dir
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    70
  $ cd dir
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    71
  $ hg grep -r tip:0 port
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    72
  port:4:export
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    73
  port:4:vaportight
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    74
  port:4:import/export
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    75
  port:3:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    76
  port:3:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    77
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    78
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    79
  port:2:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    80
  port:2:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    81
  port:2:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    82
  port:1:import
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    83
  port:1:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    84
  port:0:import
41513
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    85
  $ hg grep -r tip:0 port --config ui.relative-paths=yes
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    86
  ../port:4:export
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    87
  ../port:4:vaportight
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    88
  ../port:4:import/export
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    89
  ../port:3:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    90
  ../port:3:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    91
  ../port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    92
  ../port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    93
  ../port:2:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    94
  ../port:2:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    95
  ../port:2:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    96
  ../port:1:import
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    97
  ../port:1:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
    98
  ../port:0:import
41513
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
    99
  $ cd ..
718e9b444d97 grep: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 39930
diff changeset
   100
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   101
simple with color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   102
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   103
  $ hg --config extensions.color= grep --config color.mode=ansi \
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   104
  >     --color=always port port -r tip:0
41741
a91615b71679 color: change color of grep.rev label (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41740
diff changeset
   105
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m4\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc)
a91615b71679 color: change color of grep.rev label (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41740
diff changeset
   106
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m4\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc)
a91615b71679 color: change color of grep.rev label (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41740
diff changeset
   107
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m4\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc)
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   108
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m3\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   109
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m3\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   110
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m3\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   111
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m3\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   112
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m2\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   113
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m2\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   114
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m2\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   115
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m1\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   116
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m1\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc)
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   117
  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m0\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m (esc)
1146
9061f79c6c6f grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff changeset
   118
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   119
simple templated
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   120
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   121
  $ hg grep port -r tip:0 \
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   122
  > -T '{path}:{rev}:{node|short}:{texts % "{if(matched, text|upper, text)}"}\n'
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   123
  port:4:914fa752cdea:exPORT
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   124
  port:4:914fa752cdea:vaPORTight
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   125
  port:4:914fa752cdea:imPORT/exPORT
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   126
  port:3:95040cfd017d:exPORT
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   127
  port:3:95040cfd017d:vaPORTight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   128
  port:3:95040cfd017d:imPORT/exPORT
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   129
  port:3:95040cfd017d:imPORT/exPORT
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   130
  port:2:3b325e3481a1:exPORT
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   131
  port:2:3b325e3481a1:vaPORTight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   132
  port:2:3b325e3481a1:imPORT/exPORT
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   133
  port:1:8b20f75c1585:imPORT
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   134
  port:1:8b20f75c1585:exPORT
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   135
  port:0:f31323c92170:imPORT
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   136
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   137
  $ hg grep port -r tip:0 -T '{path}:{rev}:{texts}\n'
37500
8bb3899a0f47 formatter: make nested items somewhat readable in template output
Yuya Nishihara <yuya@tcha.org>
parents: 37449
diff changeset
   138
  port:4:export
8bb3899a0f47 formatter: make nested items somewhat readable in template output
Yuya Nishihara <yuya@tcha.org>
parents: 37449
diff changeset
   139
  port:4:vaportight
8bb3899a0f47 formatter: make nested items somewhat readable in template output
Yuya Nishihara <yuya@tcha.org>
parents: 37449
diff changeset
   140
  port:4:import/export
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   141
  port:3:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   142
  port:3:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   143
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   144
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   145
  port:2:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   146
  port:2:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   147
  port:2:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   148
  port:1:import
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   149
  port:1:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   150
  port:0:import
37500
8bb3899a0f47 formatter: make nested items somewhat readable in template output
Yuya Nishihara <yuya@tcha.org>
parents: 37449
diff changeset
   151
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   152
  $ hg grep port -r tip:0 -T '{path}:{tags}:{texts}\n'
38540
1e25782a7583 grep: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 38421
diff changeset
   153
  port:tip:export
1e25782a7583 grep: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 38421
diff changeset
   154
  port:tip:vaportight
1e25782a7583 grep: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 38421
diff changeset
   155
  port:tip:import/export
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   156
  port::export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   157
  port::vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   158
  port::import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   159
  port::import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   160
  port::export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   161
  port::vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   162
  port::import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   163
  port::import
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   164
  port::export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   165
  port::import
38540
1e25782a7583 grep: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 38421
diff changeset
   166
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   167
simple JSON (no "change" field)
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   168
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   169
  $ hg grep -r tip:0 -Tjson port
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   170
  [
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   171
   {
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   172
    "date": [4, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   173
    "lineno": 1,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   174
    "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   175
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   176
    "rev": 4,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   177
    "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   178
    "user": "spam"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   179
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   180
   {
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   181
    "date": [4, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   182
    "lineno": 2,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   183
    "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   184
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   185
    "rev": 4,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   186
    "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   187
    "user": "spam"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   188
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   189
   {
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   190
    "date": [4, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   191
    "lineno": 3,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   192
    "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   193
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   194
    "rev": 4,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   195
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   196
    "user": "spam"
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   197
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   198
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   199
    "date": [3, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   200
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   201
    "node": "95040cfd017d658c536071c6290230a613c4c2a6",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   202
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   203
    "rev": 3,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   204
    "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   205
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   206
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   207
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   208
    "date": [3, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   209
    "lineno": 2,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   210
    "node": "95040cfd017d658c536071c6290230a613c4c2a6",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   211
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   212
    "rev": 3,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   213
    "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   214
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   215
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   216
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   217
    "date": [3, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   218
    "lineno": 3,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   219
    "node": "95040cfd017d658c536071c6290230a613c4c2a6",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   220
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   221
    "rev": 3,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   222
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   223
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   224
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   225
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   226
    "date": [3, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   227
    "lineno": 4,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   228
    "node": "95040cfd017d658c536071c6290230a613c4c2a6",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   229
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   230
    "rev": 3,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   231
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   232
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   233
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   234
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   235
    "date": [2, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   236
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   237
    "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   238
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   239
    "rev": 2,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   240
    "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   241
    "user": "spam"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   242
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   243
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   244
    "date": [2, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   245
    "lineno": 2,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   246
    "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   247
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   248
    "rev": 2,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   249
    "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   250
    "user": "spam"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   251
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   252
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   253
    "date": [2, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   254
    "lineno": 3,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   255
    "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   256
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   257
    "rev": 2,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   258
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   259
    "user": "spam"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   260
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   261
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   262
    "date": [1, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   263
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   264
    "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   265
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   266
    "rev": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   267
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   268
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   269
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   270
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   271
    "date": [1, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   272
    "lineno": 2,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   273
    "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   274
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   275
    "rev": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   276
    "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   277
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   278
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   279
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   280
    "date": [0, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   281
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   282
    "node": "f31323c9217050ba245ee8b537c713ec2e8ab226",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   283
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   284
    "rev": 0,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   285
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   286
    "user": "spam"
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   287
   }
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   288
  ]
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   289
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   290
simple JSON without matching lines
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   291
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   292
  $ hg grep -r tip:0 -Tjson -l port
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   293
  [
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   294
   {
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   295
    "date": [4, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   296
    "lineno": 1,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   297
    "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   298
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   299
    "rev": 4,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   300
    "user": "spam"
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   301
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   302
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   303
    "date": [3, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   304
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   305
    "node": "95040cfd017d658c536071c6290230a613c4c2a6",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   306
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   307
    "rev": 3,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   308
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   309
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   310
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   311
    "date": [2, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   312
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   313
    "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   314
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   315
    "rev": 2,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   316
    "user": "spam"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   317
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   318
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   319
    "date": [1, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   320
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   321
    "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   322
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   323
    "rev": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   324
    "user": "eggs"
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   325
   },
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   326
   {
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   327
    "date": [0, 0],
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   328
    "lineno": 1,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   329
    "node": "f31323c9217050ba245ee8b537c713ec2e8ab226",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   330
    "path": "port",
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   331
    "rev": 0,
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   332
    "user": "spam"
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   333
   }
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   334
  ]
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   335
45430
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   336
diff of each revision for reference
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   337
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   338
  $ hg log -p -T'== rev: {rev} ==\n'
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   339
  == rev: 4 ==
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   340
  diff -r 95040cfd017d -r 914fa752cdea port
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   341
  --- a/port	Thu Jan 01 00:00:03 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   342
  +++ b/port	Thu Jan 01 00:00:04 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   343
  @@ -1,4 +1,3 @@
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   344
   export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   345
   vaportight
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   346
   import/export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   347
  -import/export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   348
  
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   349
  == rev: 3 ==
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   350
  diff -r 3b325e3481a1 -r 95040cfd017d port
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   351
  --- a/port	Thu Jan 01 00:00:02 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   352
  +++ b/port	Thu Jan 01 00:00:03 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   353
  @@ -1,3 +1,4 @@
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   354
   export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   355
   vaportight
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   356
   import/export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   357
  +import/export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   358
  
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   359
  == rev: 2 ==
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   360
  diff -r 8b20f75c1585 -r 3b325e3481a1 port
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   361
  --- a/port	Thu Jan 01 00:00:01 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   362
  +++ b/port	Thu Jan 01 00:00:02 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   363
  @@ -1,2 +1,3 @@
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   364
  -import
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   365
   export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   366
  +vaportight
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   367
  +import/export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   368
  
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   369
  == rev: 1 ==
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   370
  diff -r f31323c92170 -r 8b20f75c1585 port
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   371
  --- a/port	Thu Jan 01 00:00:00 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   372
  +++ b/port	Thu Jan 01 00:00:01 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   373
  @@ -1,1 +1,2 @@
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   374
   import
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   375
  +export
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   376
  
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   377
  == rev: 0 ==
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   378
  diff -r 000000000000 -r f31323c92170 port
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   379
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   380
  +++ b/port	Thu Jan 01 00:00:00 1970 +0000
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   381
  @@ -0,0 +1,1 @@
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   382
  +import
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   383
  
e47385ef4e17 grep: fix hash(linestate) to not include linenum
Yuya Nishihara <yuya@tcha.org>
parents: 45429
diff changeset
   384
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   385
all
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   386
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   387
  $ hg grep --traceback --all -nu port port
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   388
  port:4:4:-:spam:import/export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   389
  port:3:4:+:eggs:import/export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   390
  port:2:1:-:spam:import
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   391
  port:2:2:+:spam:vaportight
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   392
  port:2:3:+:spam:import/export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   393
  port:1:2:+:eggs:export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   394
  port:0:1:+:spam:import
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   395
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   396
all JSON
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   397
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   398
  $ hg grep --all -Tjson port port
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   399
  [
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   400
   {
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   401
    "change": "-",
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   402
    "date": [4, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   403
    "lineno": 4,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   404
    "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   405
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   406
    "rev": 4,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   407
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   408
    "user": "spam"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   409
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   410
   {
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   411
    "change": "+",
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   412
    "date": [3, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   413
    "lineno": 4,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   414
    "node": "95040cfd017d658c536071c6290230a613c4c2a6",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   415
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   416
    "rev": 3,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   417
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   418
    "user": "eggs"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   419
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   420
   {
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   421
    "change": "-",
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   422
    "date": [2, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   423
    "lineno": 1,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   424
    "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   425
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   426
    "rev": 2,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   427
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   428
    "user": "spam"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   429
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   430
   {
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   431
    "change": "+",
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   432
    "date": [2, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   433
    "lineno": 2,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   434
    "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   435
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   436
    "rev": 2,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   437
    "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   438
    "user": "spam"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   439
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   440
   {
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   441
    "change": "+",
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   442
    "date": [2, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   443
    "lineno": 3,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   444
    "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   445
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   446
    "rev": 2,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   447
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   448
    "user": "spam"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   449
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   450
   {
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   451
    "change": "+",
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   452
    "date": [1, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   453
    "lineno": 2,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   454
    "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   455
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   456
    "rev": 1,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   457
    "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   458
    "user": "eggs"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   459
   },
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   460
   {
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   461
    "change": "+",
37770
31750413f8d7 formatter: convert timestamp to int
Yuya Nishihara <yuya@tcha.org>
parents: 37500
diff changeset
   462
    "date": [0, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   463
    "lineno": 1,
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   464
    "node": "f31323c9217050ba245ee8b537c713ec2e8ab226",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   465
    "path": "port",
29858
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   466
    "rev": 0,
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   467
    "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   468
    "user": "spam"
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   469
   }
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   470
  ]
33461139c31c grep: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents: 29854
diff changeset
   471
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   472
other
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   473
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   474
  $ hg grep -r tip:0 -l port port
17805
21c93988ca70 test-grep: add a test for -l
Idan Kamara <idankk86@gmail.com>
parents: 16912
diff changeset
   475
  port:4
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   476
  port:3
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   477
  port:2
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   478
  port:1
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   479
  port:0
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   480
  $ hg grep -r tip:0 import port
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   481
  port:4:import/export
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   482
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   483
  port:3:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   484
  port:2:import/export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   485
  port:1:import
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   486
  port:0:import
2870
8eaaf1321bfe grep: add --follow support.
Brendan Cully <brendan@kublai.com>
parents: 2869
diff changeset
   487
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   488
  $ hg cp port port2
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   489
  $ hg commit -m 4 -u spam -d '5 0'
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   490
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   491
follow
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   492
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   493
  $ hg grep -r tip:0 --traceback -f 'import\n\Z' port2
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   494
  [1]
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   495
  $ echo deport >> port2
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   496
  $ hg commit -m 5 -u eggs -d '6 0'
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   497
  $ hg grep -f --all -nu port port2
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   498
  port2:6:4:+:eggs:deport
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   499
  port:4:4:-:spam:import/export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   500
  port:3:4:+:eggs:import/export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   501
  port:2:1:-:spam:import
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   502
  port:2:2:+:spam:vaportight
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   503
  port:2:3:+:spam:import/export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   504
  port:1:2:+:eggs:export
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   505
  port:0:1:+:spam:import
3951
cb66641cdee3 grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3950
diff changeset
   506
24064
c260887cdbcd log: fix --follow null parent not to include revision 0
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
   507
  $ hg up -q null
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   508
  $ hg grep -r 'reverse(:.)' -f port
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   509
  port:0:import
24064
c260887cdbcd log: fix --follow null parent not to include revision 0
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
   510
37447
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   511
Test wdir
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   512
(at least, this shouldn't crash)
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   513
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   514
  $ hg up -q
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   515
  $ echo wport >> port2
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   516
  $ hg stat
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   517
  M port2
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   518
  $ hg grep -r 'wdir()' port
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   519
  port:2147483647:export
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   520
  port:2147483647:vaportight
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   521
  port:2147483647:import/export
38217
16f93a3b8b05 grep: enable passing wdir as a revision
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 37770
diff changeset
   522
  port2:2147483647:export
16f93a3b8b05 grep: enable passing wdir as a revision
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 37770
diff changeset
   523
  port2:2147483647:vaportight
16f93a3b8b05 grep: enable passing wdir as a revision
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 37770
diff changeset
   524
  port2:2147483647:import/export
16f93a3b8b05 grep: enable passing wdir as a revision
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 37770
diff changeset
   525
  port2:2147483647:deport
16f93a3b8b05 grep: enable passing wdir as a revision
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 37770
diff changeset
   526
  port2:2147483647:wport
37447
067e8d1178a2 workingctx: build _manifest on filenode() or flags() request
Yuya Nishihara <yuya@tcha.org>
parents: 37133
diff changeset
   527
51364
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   528
Testing include/exclude
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   529
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   530
  $ hg cp port tort
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   531
  $ hg grep port -X tort
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   532
  port:export
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   533
  port:vaportight
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   534
  port:import/export
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   535
  port2:export
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   536
  port2:vaportight
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   537
  port2:import/export
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   538
  port2:deport
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   539
  port2:wport
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   540
  $ hg grep port -I tort
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   541
  tort:export
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   542
  tort:vaportight
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   543
  tort:import/export
c6560ee526d2 grep: restore usage of --include/--exclude options
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 48553
diff changeset
   544
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   545
  $ cd ..
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   546
  $ hg init t2
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   547
  $ cd t2
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   548
  $ hg grep -r tip:0 foobar foo
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11902
diff changeset
   549
  [1]
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   550
  $ hg grep -r tip:0 foobar
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11902
diff changeset
   551
  [1]
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   552
  $ echo blue >> color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   553
  $ echo black >> color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   554
  $ hg add color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   555
  $ hg ci -m 0
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   556
  $ echo orange >> color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   557
  $ hg ci -m 1
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   558
  $ echo black > color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   559
  $ hg ci -m 2
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   560
  $ echo orange >> color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   561
  $ echo blue >> color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   562
  $ hg ci -m 3
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   563
  $ hg grep -r tip:0 orange
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   564
  color:3:orange
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   565
  color:1:orange
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   566
  $ hg grep --all orange
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   567
  color:3:+:orange
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   568
  color:2:-:orange
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   569
  color:1:+:orange
41739
8ab42ccb68fe grep: give different labels to + and - symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41683
diff changeset
   570
  $ hg grep --diff orange --color=debug
8ab42ccb68fe grep: give different labels to + and - symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41683
diff changeset
   571
  [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.inserted grep.change|+][grep.sep|:][grep.match|orange]
8ab42ccb68fe grep: give different labels to + and - symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41683
diff changeset
   572
  [grep.filename|color][grep.sep|:][grep.rev|2][grep.sep|:][grep.deleted grep.change|-][grep.sep|:][grep.match|orange]
8ab42ccb68fe grep: give different labels to + and - symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41683
diff changeset
   573
  [grep.filename|color][grep.sep|:][grep.rev|1][grep.sep|:][grep.inserted grep.change|+][grep.sep|:][grep.match|orange]
5106
ee702e7f181f test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents: 4877
diff changeset
   574
41740
ee77a6dd8fb8 color: give colours to the grep.inserted and grep.deleted labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41739
diff changeset
   575
  $ hg grep --diff orange --color=yes
41741
a91615b71679 color: change color of grep.rev label (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41740
diff changeset
   576
  \x1b[0;35mcolor\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m3\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32;1m+\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;31;1morange\x1b[0m (esc)
a91615b71679 color: change color of grep.rev label (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41740
diff changeset
   577
  \x1b[0;35mcolor\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m2\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;31;1m-\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;31;1morange\x1b[0m (esc)
a91615b71679 color: change color of grep.rev label (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41740
diff changeset
   578
  \x1b[0;35mcolor\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;34m1\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32;1m+\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;31;1morange\x1b[0m (esc)
41740
ee77a6dd8fb8 color: give colours to the grep.inserted and grep.deleted labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41739
diff changeset
   579
38421
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   580
  $ hg grep --diff orange
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   581
  color:3:+:orange
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   582
  color:2:-:orange
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   583
  color:1:+:orange
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   584
45725
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   585
revset predicate for "grep --diff"
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   586
45750
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
   587
  $ hg log -qr 'diffcontains("re:^bl...$")'
45725
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   588
  0:203191eb5e21
45750
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
   589
  $ hg log -qr 'diffcontains("orange")'
45725
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   590
  1:7c585a21e0d1
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   591
  2:11bd8bc8d653
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   592
  3:e0116d3829f8
45750
c00595736595 revset: rename diff(pattern) to diffcontains(pattern)
Yuya Nishihara <yuya@tcha.org>
parents: 45725
diff changeset
   593
  $ hg log -qr '2:0 & diffcontains("orange")'
45725
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   594
  2:11bd8bc8d653
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   595
  1:7c585a21e0d1
99b8b73eb622 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org>
parents: 45650
diff changeset
   596
29854
b842b1adfea2 grep: refactor loop that yields matched text with label
Yuya Nishihara <yuya@tcha.org>
parents: 24064
diff changeset
   597
test substring match: '^' should only match at the beginning
b842b1adfea2 grep: refactor loop that yields matched text with label
Yuya Nishihara <yuya@tcha.org>
parents: 24064
diff changeset
   598
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   599
  $ hg grep -r tip:0 '^.' --config extensions.color= --color debug
29854
b842b1adfea2 grep: refactor loop that yields matched text with label
Yuya Nishihara <yuya@tcha.org>
parents: 24064
diff changeset
   600
  [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lack
b842b1adfea2 grep: refactor loop that yields matched text with label
Yuya Nishihara <yuya@tcha.org>
parents: 24064
diff changeset
   601
  [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|o]range
b842b1adfea2 grep: refactor loop that yields matched text with label
Yuya Nishihara <yuya@tcha.org>
parents: 24064
diff changeset
   602
  [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lue
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   603
  [grep.filename|color][grep.sep|:][grep.rev|2][grep.sep|:][grep.match|b]lack
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   604
  [grep.filename|color][grep.sep|:][grep.rev|1][grep.sep|:][grep.match|b]lue
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   605
  [grep.filename|color][grep.sep|:][grep.rev|1][grep.sep|:][grep.match|b]lack
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   606
  [grep.filename|color][grep.sep|:][grep.rev|1][grep.sep|:][grep.match|o]range
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   607
  [grep.filename|color][grep.sep|:][grep.rev|0][grep.sep|:][grep.match|b]lue
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   608
  [grep.filename|color][grep.sep|:][grep.rev|0][grep.sep|:][grep.match|b]lack
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   609
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   610
match in last "line" without newline
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   611
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39369
diff changeset
   612
  $ "$PYTHON" -c 'fp = open("noeol", "wb"); fp.write(b"no infinite loop"); fp.close();'
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   613
  $ hg ci -Amnoeol
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   614
  adding noeol
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   615
  $ hg grep -r tip:0 loop
15293
0e34699d6988 grep: correct handling of matching lines without line ending (issue3050)
Mads Kiilerich <mads@kiilerich.com>
parents: 13956
diff changeset
   616
  noeol:4:no infinite loop
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   617
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   618
  $ cd ..
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   619
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 21011
diff changeset
   620
Issue685: traceback in grep -r after rename
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
   621
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   622
Got a traceback when using grep on a single
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   623
revision with renamed files.
7240
dac14cc9711e test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents: 5107
diff changeset
   624
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   625
  $ hg init issue685
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   626
  $ cd issue685
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   627
  $ echo octarine > color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   628
  $ hg ci -Amcolor
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   629
  adding color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   630
  $ hg rename color colour
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   631
  $ hg ci -Am rename
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   632
  $ hg grep -r tip:0 octarine
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   633
  colour:1:octarine
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   634
  color:0:octarine
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   635
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   636
Used to crash here
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   637
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   638
  $ hg grep -r 1 octarine
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   639
  colour:1:octarine
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   640
  $ cd ..
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   641
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   642
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   643
Issue337: test that grep follows parent-child relationships instead
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   644
of just using revision numbers.
7240
dac14cc9711e test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents: 5107
diff changeset
   645
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   646
  $ hg init issue337
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   647
  $ cd issue337
8849
80cc4b1a62d0 compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 8167
diff changeset
   648
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   649
  $ echo white > color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   650
  $ hg commit -A -m "0 white"
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   651
  adding color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   652
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   653
  $ echo red > color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   654
  $ hg commit -A -m "1 red"
8849
80cc4b1a62d0 compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 8167
diff changeset
   655
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   656
  $ hg update 0
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   657
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   658
  $ echo black > color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   659
  $ hg commit -A -m "2 black"
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   660
  created new head
8849
80cc4b1a62d0 compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 8167
diff changeset
   661
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   662
  $ hg update --clean 1
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   663
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   664
  $ echo blue > color
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   665
  $ hg commit -A -m "3 blue"
8849
80cc4b1a62d0 compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 8167
diff changeset
   666
11902
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   667
  $ hg grep --all red
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   668
  color:3:-:red
3c9a5ed9b1e2 tests: unify test-grep
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11141
diff changeset
   669
  color:1:+:red
13920
332e400764e5 grep: don't print data from binary files for matches (issue2614)
Md. O. Shayan <mdoshayan@gmail.com>
parents: 12942
diff changeset
   670
38421
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   671
  $ hg grep --diff red
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   672
  color:3:-:red
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   673
  color:1:+:red
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   674
37133
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   675
Issue3885: test that changing revision order does not alter the
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   676
revisions printed, just their order.
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   677
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   678
  $ hg grep --all red -r "all()"
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   679
  color:1:+:red
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   680
  color:3:-:red
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   681
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   682
  $ hg grep --all red -r "reverse(all())"
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   683
  color:3:-:red
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   684
  color:1:+:red
a2a6755a3def grep: fixes erroneous output of grep in forward order (issue3885)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 36495
diff changeset
   685
38421
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   686
  $ hg grep --diff red -r "all()"
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   687
  color:1:+:red
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   688
  color:3:-:red
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   689
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   690
  $ hg grep --diff red -r "reverse(all())"
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   691
  color:3:-:red
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   692
  color:1:+:red
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   693
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   694
  $ cd ..
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   695
13920
332e400764e5 grep: don't print data from binary files for matches (issue2614)
Md. O. Shayan <mdoshayan@gmail.com>
parents: 12942
diff changeset
   696
  $ hg init a
332e400764e5 grep: don't print data from binary files for matches (issue2614)
Md. O. Shayan <mdoshayan@gmail.com>
parents: 12942
diff changeset
   697
  $ cd a
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15765
diff changeset
   698
  $ cp "$TESTDIR/binfile.bin" .
13920
332e400764e5 grep: don't print data from binary files for matches (issue2614)
Md. O. Shayan <mdoshayan@gmail.com>
parents: 12942
diff changeset
   699
  $ hg add binfile.bin
332e400764e5 grep: don't print data from binary files for matches (issue2614)
Md. O. Shayan <mdoshayan@gmail.com>
parents: 12942
diff changeset
   700
  $ hg ci -m 'add binfile.bin'
332e400764e5 grep: don't print data from binary files for matches (issue2614)
Md. O. Shayan <mdoshayan@gmail.com>
parents: 12942
diff changeset
   701
  $ hg grep "MaCam" --all
332e400764e5 grep: don't print data from binary files for matches (issue2614)
Md. O. Shayan <mdoshayan@gmail.com>
parents: 12942
diff changeset
   702
  binfile.bin:0:+: Binary file matches
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   703
38421
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   704
  $ hg grep "MaCam" --diff
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   705
  binfile.bin:0:+: Binary file matches
7fbb5d76c555 grep: add --diff flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38342
diff changeset
   706
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   707
  $ cd ..
38217
16f93a3b8b05 grep: enable passing wdir as a revision
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 37770
diff changeset
   708
45429
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   709
Moved line may not be collected by "grep --diff" since it first filters
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   710
the contents to be diffed by the pattern. (i.e.
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   711
"diff <(grep pat a) <(grep pat b)", not "diff a b | grep pat".)
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   712
This is much faster than generating full diff per revision.
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   713
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   714
  $ hg init moved-line
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   715
  $ cd moved-line
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   716
  $ cat <<'EOF' > a
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   717
  > foo
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   718
  > bar
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   719
  > baz
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   720
  > EOF
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   721
  $ hg ci -Am initial
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   722
  adding a
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   723
  $ cat <<'EOF' > a
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   724
  > bar
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   725
  > baz
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   726
  > foo
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   727
  > EOF
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   728
  $ hg ci -m reorder
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   729
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   730
  $ hg diff -c 1
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   731
  diff -r a593cc55e81b -r 69789a3b6e80 a
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   732
  --- a/a	Thu Jan 01 00:00:00 1970 +0000
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   733
  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   734
  @@ -1,3 +1,3 @@
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   735
  -foo
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   736
   bar
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   737
   baz
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   738
  +foo
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   739
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   740
 can't find the move of "foo" at the revision 1:
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   741
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   742
  $ hg grep --diff foo -r1
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   743
  [1]
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   744
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   745
 "bar" isn't moved at the revisoin 1:
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   746
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   747
  $ hg grep --diff bar -r1
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   748
  [1]
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   749
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   750
  $ cd ..
9c8d2cf7f591 test-grep: document that trivially moved lines might not be detected
Yuya Nishihara <yuya@tcha.org>
parents: 44864
diff changeset
   751
38342
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   752
Test for showing working of allfiles flag
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   753
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   754
  $ hg init sng
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   755
  $ cd sng
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   756
  $ echo "unmod" >> um
44848
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   757
  $ echo old > old
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   758
  $ hg ci -q -A -m "adds unmod to um"
38342
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   759
  $ echo "something else" >> new
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   760
  $ hg ci -A -m "second commit"
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   761
  adding new
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   762
  $ hg grep -r "." "unmod"
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   763
  um:1:unmod
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   764
44848
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   765
Existing tracked files in the working directory are searched by default
38650
eba69ddd4e52 grep: search working directory files by default if --all-files is specified
Yuya Nishihara <yuya@tcha.org>
parents: 38649
diff changeset
   766
eba69ddd4e52 grep: search working directory files by default if --all-files is specified
Yuya Nishihara <yuya@tcha.org>
parents: 38649
diff changeset
   767
  $ echo modified >> new
44848
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   768
  $ echo 'added' > added; hg add added
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   769
  $ echo 'added, missing' > added-missing; hg add added-missing; rm added-missing
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   770
  $ echo 'untracked' > untracked
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   771
  $ hg rm old
44849
f90957c947f4 grep: don't go in an infinite loop when given empty regex
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44848
diff changeset
   772
  $ hg grep ''
44848
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   773
  added:added
7e7080ab8ba8 grep: improve test coverage
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 43304
diff changeset
   774
  new:something else
38653
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   775
  new:modified
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   776
  um:unmod
38650
eba69ddd4e52 grep: search working directory files by default if --all-files is specified
Yuya Nishihara <yuya@tcha.org>
parents: 38649
diff changeset
   777
44863
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   778
#if symlink
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   779
Grepping a symlink greps its destination
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   780
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   781
  $ rm -f added; ln -s symlink-added added
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   782
  $ hg grep '' | grep added
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   783
  added:symlink-added
44864
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   784
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   785
But we reject symlinks as directories components of a tracked file as
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   786
usual:
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   787
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   788
  $ mkdir dir; touch dir/f; hg add dir/f
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   789
  $ rm -rf dir; ln -s / dir
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   790
  $ hg grep ''
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   791
  abort: path 'dir/f' traverses symbolic link 'dir'
06105aa8bc0e grep: test that paths get audited
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44863
diff changeset
   792
  [255]
44863
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   793
#endif
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   794
3db660b8eba6 grep: add test coverage of behavior on symlinks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 44849
diff changeset
   795
But we can search files from some other revision with -rREV
38650
eba69ddd4e52 grep: search working directory files by default if --all-files is specified
Yuya Nishihara <yuya@tcha.org>
parents: 38649
diff changeset
   796
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   797
  $ hg grep -r. mod
38650
eba69ddd4e52 grep: search working directory files by default if --all-files is specified
Yuya Nishihara <yuya@tcha.org>
parents: 38649
diff changeset
   798
  um:1:unmod
eba69ddd4e52 grep: search working directory files by default if --all-files is specified
Yuya Nishihara <yuya@tcha.org>
parents: 38649
diff changeset
   799
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   800
  $ hg grep --diff mod
38651
5e4027db52f4 grep: add config knob to enable/disable the default wdir search
Yuya Nishihara <yuya@tcha.org>
parents: 38650
diff changeset
   801
  um:0:+:unmod
5e4027db52f4 grep: add config knob to enable/disable the default wdir search
Yuya Nishihara <yuya@tcha.org>
parents: 38650
diff changeset
   802
38342
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   803
  $ cd ..
b8f45fc27370 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38217
diff changeset
   804
38652
bfcd5c7cbf9a grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
Yuya Nishihara <yuya@tcha.org>
parents: 38651
diff changeset
   805
Change Default of grep by ui.tweakdefaults, that is, the files not in current
bfcd5c7cbf9a grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
Yuya Nishihara <yuya@tcha.org>
parents: 38651
diff changeset
   806
working directory should not be grepp-ed on
bfcd5c7cbf9a grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
Yuya Nishihara <yuya@tcha.org>
parents: 38651
diff changeset
   807
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   808
  $ hg init ab
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   809
  $ cd ab
38652
bfcd5c7cbf9a grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
Yuya Nishihara <yuya@tcha.org>
parents: 38651
diff changeset
   810
  $ cat <<'EOF' >> .hg/hgrc
bfcd5c7cbf9a grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
Yuya Nishihara <yuya@tcha.org>
parents: 38651
diff changeset
   811
  > [ui]
bfcd5c7cbf9a grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
Yuya Nishihara <yuya@tcha.org>
parents: 38651
diff changeset
   812
  > tweakdefaults = True
bfcd5c7cbf9a grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
Yuya Nishihara <yuya@tcha.org>
parents: 38651
diff changeset
   813
  > EOF
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   814
  $ echo "some text">>file1
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   815
  $ hg add file1
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   816
  $ hg commit -m "adds file1"
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   817
  $ hg mv file1 file2
38653
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   818
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   819
wdir revision is hidden by default:
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   820
38631
9ef10437bb88 grep: change default behaviour to search working directory files (BC)
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38540
diff changeset
   821
  $ hg grep "some"
38653
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   822
  file2:some text
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   823
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   824
but it should be available in template dict:
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   825
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   826
  $ hg grep "some" -Tjson
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   827
  [
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   828
   {
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   829
    "date": [0, 0],
39930
66df1059b7c0 grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
   830
    "lineno": 1,
38653
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   831
    "node": "ffffffffffffffffffffffffffffffffffffffff",
39369
34ba47117164 formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39044
diff changeset
   832
    "path": "file2",
38653
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   833
    "rev": 2147483647,
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   834
    "texts": [{"matched": true, "text": "some"}, {"matched": false, "text": " text"}],
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   835
    "user": "test"
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   836
   }
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   837
  ]
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   838
aabc01da9834 grep: hide cryptic revision number by default
Yuya Nishihara <yuya@tcha.org>
parents: 38652
diff changeset
   839
  $ cd ..
38946
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   840
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   841
test -rMULTIREV
38946
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   842
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   843
  $ cd sng
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   844
  $ hg rm um
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   845
  $ hg commit -m "deletes um"
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   846
  $ hg grep -r "0:2" "unmod"
38946
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   847
  um:0:unmod
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   848
  um:1:unmod
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   849
  $ hg grep -r "0:2" "unmod" um
38960
d99468d2b09a grep: search all commits in allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38946
diff changeset
   850
  um:0:unmod
d99468d2b09a grep: search all commits in allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38946
diff changeset
   851
  um:1:unmod
43304
8cb5f96db235 grep: enable all-files by default (BC)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41741
diff changeset
   852
  $ hg grep -r "0:2" "unmod" "glob:**/um" # Check that patterns also work
41683
5d383d9636d0 walkchangerevs: obey allfiles parameter when taking the slow path
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41513
diff changeset
   853
  um:0:unmod
5d383d9636d0 walkchangerevs: obey allfiles parameter when taking the slow path
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 41513
diff changeset
   854
  um:1:unmod
38946
f3f109971359 grep: add MULTIREV support to --allfiles flag
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38653
diff changeset
   855
  $ cd ..
38960
d99468d2b09a grep: search all commits in allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
parents: 38946
diff changeset
   856
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   857
--follow with/without --diff and/or paths
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   858
-----------------------------------------
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   859
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   860
For each test case, we compare the history traversal of "hg log",
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   861
"hg grep --diff", and "hg grep" (--all-files).
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   862
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   863
"hg grep --diff" should traverse the log in the same way as "hg log".
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   864
"hg grep" (--all-files) is slightly different in that it includes
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   865
unmodified changes.
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   866
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   867
  $ hg init follow
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   868
  $ cd follow
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   869
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   870
  $ cat <<'EOF' >> .hg/hgrc
45765
ed84a4d48910 config: add a new [command-templates] section for templates defined by hg
Martin von Zweigbergk <martinvonz@google.com>
parents: 45750
diff changeset
   871
  > [command-templates]
ed84a4d48910 config: add a new [command-templates] section for templates defined by hg
Martin von Zweigbergk <martinvonz@google.com>
parents: 45750
diff changeset
   872
  > log = '{rev}: {join(files % "{status} {path}", ", ")}\n'
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   873
  > EOF
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   874
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   875
  $ for f in add0 add0-mod1 add0-rm1 add0-mod2 add0-rm2 add0-mod3 add0-mod4 add0-rm4; do
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   876
  > echo data0 >> $f
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   877
  > done
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   878
  $ hg ci -qAm0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   879
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   880
  $ hg cp add0 add0-cp1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   881
  $ hg cp add0 add0-cp1-mod1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   882
  $ hg cp add0 add0-cp1-mod1-rm3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   883
  $ hg rm add0-rm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   884
  $ for f in *mod1*; do
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   885
  > echo data1 >> $f
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   886
  > done
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   887
  $ hg ci -qAm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   888
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   889
  $ hg update -q 0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   890
  $ hg cp add0 add0-cp2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   891
  $ hg cp add0 add0-cp2-mod2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   892
  $ hg rm add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   893
  $ for f in *mod2*; do
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   894
  > echo data2 >> $f
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   895
  > done
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   896
  $ hg ci -qAm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   897
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   898
  $ hg update -q 1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   899
  $ hg cp add0-cp1 add0-cp1-cp3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   900
  $ hg cp add0-cp1-mod1 add0-cp1-mod1-cp3-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   901
  $ hg rm add0-cp1-mod1-rm3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   902
  $ for f in *mod3*; do
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   903
  > echo data3 >> $f
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   904
  > done
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   905
  $ hg ci -qAm3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   906
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   907
  $ hg cp add0 add0-cp4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   908
  $ hg cp add0 add0-cp4-mod4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   909
  $ hg rm add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   910
  $ for f in *mod4*; do
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   911
  > echo data4 >> $f
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   912
  > done
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   913
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   914
  $ hg log -Gr':wdir()'
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   915
  o  2147483647: A add0-cp4, A add0-cp4-mod4, M add0-mod4, R add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   916
  |
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   917
  @  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   918
  |
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   919
  | o  2: A add0-cp2, A add0-cp2-mod2, M add0-mod2, R add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   920
  | |
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   921
  o |  1: A add0-cp1, A add0-cp1-mod1, A add0-cp1-mod1-rm3, M add0-mod1, R add0-rm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   922
  |/
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   923
  o  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   924
  
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   925
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   926
follow revision history from wdir parent:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   927
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   928
  $ hg log -f
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   929
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   930
  1: A add0-cp1, A add0-cp1-mod1, A add0-cp1-mod1-rm3, M add0-mod1, R add0-rm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   931
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   932
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   933
  $ hg grep --diff -f data
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   934
  add0-cp1-mod1-cp3-mod3:3:+:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   935
  add0-mod3:3:+:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   936
  add0-cp1-mod1:1:+:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   937
  add0-cp1-mod1-rm3:1:+:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   938
  add0-mod1:1:+:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   939
  add0:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   940
  add0-mod1:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   941
  add0-mod2:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   942
  add0-mod3:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   943
  add0-mod4:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   944
  add0-rm1:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   945
  add0-rm2:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   946
  add0-rm4:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   947
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   948
  $ hg grep -f data
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   949
  add0:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   950
  add0-cp1:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   951
  add0-cp1-cp3:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   952
  add0-cp1-mod1:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   953
  add0-cp1-mod1:3:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   954
  add0-cp1-mod1-cp3-mod3:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   955
  add0-cp1-mod1-cp3-mod3:3:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   956
  add0-cp1-mod1-cp3-mod3:3:data3
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   957
  add0-mod1:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   958
  add0-mod1:3:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   959
  add0-mod2:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   960
  add0-mod3:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   961
  add0-mod3:3:data3
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   962
  add0-mod4:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   963
  add0-rm2:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   964
  add0-rm4:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   965
  add0:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   966
  add0-cp1:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   967
  add0-cp1-mod1:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   968
  add0-cp1-mod1:1:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   969
  add0-cp1-mod1-rm3:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   970
  add0-cp1-mod1-rm3:1:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   971
  add0-mod1:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   972
  add0-mod1:1:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   973
  add0-mod2:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   974
  add0-mod3:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   975
  add0-mod4:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   976
  add0-rm2:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   977
  add0-rm4:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   978
  add0:0:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   979
  add0-mod1:0:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   980
  add0-mod2:0:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   981
  add0-mod3:0:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   982
  add0-mod4:0:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   983
  add0-rm1:0:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   984
  add0-rm2:0:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
   985
  add0-rm4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   986
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   987
follow revision history from specified revision:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   988
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   989
  $ hg log -fr2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   990
  2: A add0-cp2, A add0-cp2-mod2, M add0-mod2, R add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   991
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   992
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   993
  $ hg grep --diff -fr2 data
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   994
  add0-cp2-mod2:2:+:data2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
   995
  add0-mod2:2:+:data2
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
   996
  add0:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
   997
  add0-mod1:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
   998
  add0-mod2:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
   999
  add0-mod3:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1000
  add0-mod4:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1001
  add0-rm1:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1002
  add0-rm2:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1003
  add0-rm4:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1004
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1005
  $ hg grep -fr2 data
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1006
  add0:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1007
  add0-cp2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1008
  add0-cp2-mod2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1009
  add0-cp2-mod2:2:data2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1010
  add0-mod1:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1011
  add0-mod2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1012
  add0-mod2:2:data2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1013
  add0-mod3:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1014
  add0-mod4:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1015
  add0-rm1:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1016
  add0-rm4:2:data0
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1017
  add0:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1018
  add0-mod1:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1019
  add0-mod2:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1020
  add0-mod3:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1021
  add0-mod4:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1022
  add0-rm1:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1023
  add0-rm2:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1024
  add0-rm4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1025
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1026
follow revision history from wdir:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1027
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1028
  $ hg log -fr'wdir()'
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1029
  2147483647: A add0-cp4, A add0-cp4-mod4, M add0-mod4, R add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1030
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1031
  1: A add0-cp1, A add0-cp1-mod1, A add0-cp1-mod1-rm3, M add0-mod1, R add0-rm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1032
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1033
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1034
 BROKEN: should not abort because of removed file
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1035
  $ hg grep --diff -fr'wdir()' data
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1036
  add0-cp4-mod4:2147483647:+:data4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1037
  add0-mod4:2147483647:+:data4
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45895
diff changeset
  1038
  add0-rm4:2147483647:-:abort: add0-rm4@None: not found in manifest
46116
17a695357270 errors: use detailed exit code 50 for StorageError
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
  1039
  [50]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1040
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1041
  $ hg grep -fr'wdir()' data
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1042
  add0:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1043
  add0-cp1:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1044
  add0-cp1-cp3:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1045
  add0-cp1-mod1:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1046
  add0-cp1-mod1:2147483647:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1047
  add0-cp1-mod1-cp3-mod3:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1048
  add0-cp1-mod1-cp3-mod3:2147483647:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1049
  add0-cp1-mod1-cp3-mod3:2147483647:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1050
  add0-cp4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1051
  add0-cp4-mod4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1052
  add0-cp4-mod4:2147483647:data4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1053
  add0-mod1:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1054
  add0-mod1:2147483647:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1055
  add0-mod2:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1056
  add0-mod3:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1057
  add0-mod3:2147483647:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1058
  add0-mod4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1059
  add0-mod4:2147483647:data4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1060
  add0-rm2:2147483647:data0
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1061
  add0:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1062
  add0-cp1:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1063
  add0-cp1-cp3:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1064
  add0-cp1-mod1:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1065
  add0-cp1-mod1:3:data1
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1066
  add0-cp1-mod1-cp3-mod3:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1067
  add0-cp1-mod1-cp3-mod3:3:data1
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1068
  add0-cp1-mod1-cp3-mod3:3:data3
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1069
  add0-mod1:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1070
  add0-mod1:3:data1
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1071
  add0-mod2:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1072
  add0-mod3:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1073
  add0-mod3:3:data3
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1074
  add0-mod4:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1075
  add0-rm2:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1076
  add0-rm4:3:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1077
  add0:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1078
  add0-cp1:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1079
  add0-cp1-mod1:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1080
  add0-cp1-mod1:1:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1081
  add0-cp1-mod1-rm3:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1082
  add0-cp1-mod1-rm3:1:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1083
  add0-mod1:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1084
  add0-mod1:1:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1085
  add0-mod2:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1086
  add0-mod3:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1087
  add0-mod4:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1088
  add0-rm2:1:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1089
  add0-rm4:1:data0
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1090
  add0:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1091
  add0-mod1:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1092
  add0-mod2:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1093
  add0-mod3:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1094
  add0-mod4:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1095
  add0-rm1:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1096
  add0-rm2:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1097
  add0-rm4:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1098
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1099
follow revision history from multiple revisions:
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1100
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1101
  $ hg log -fr'1+2'
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1102
  2: A add0-cp2, A add0-cp2-mod2, M add0-mod2, R add0-rm2
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1103
  1: A add0-cp1, A add0-cp1-mod1, A add0-cp1-mod1-rm3, M add0-mod1, R add0-rm1
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1104
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1105
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1106
  $ hg grep --diff -fr'1+2' data
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1107
  add0-cp2-mod2:2:+:data2
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1108
  add0-mod2:2:+:data2
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1109
  add0-cp1-mod1:1:+:data1
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1110
  add0-cp1-mod1-rm3:1:+:data1
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1111
  add0-mod1:1:+:data1
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1112
  add0:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1113
  add0-mod1:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1114
  add0-mod2:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1115
  add0-mod3:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1116
  add0-mod4:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1117
  add0-rm1:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1118
  add0-rm2:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1119
  add0-rm4:0:+:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1120
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1121
  $ hg grep -fr'1+2' data
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1122
  add0:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1123
  add0-cp2:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1124
  add0-cp2-mod2:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1125
  add0-cp2-mod2:2:data2
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1126
  add0-mod1:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1127
  add0-mod2:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1128
  add0-mod2:2:data2
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1129
  add0-mod3:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1130
  add0-mod4:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1131
  add0-rm1:2:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1132
  add0-rm4:2:data0
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1133
  add0:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1134
  add0-cp1:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1135
  add0-cp1-mod1:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1136
  add0-cp1-mod1:1:data1
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1137
  add0-cp1-mod1-rm3:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1138
  add0-cp1-mod1-rm3:1:data1
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1139
  add0-mod1:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1140
  add0-mod1:1:data1
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1141
  add0-mod2:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1142
  add0-mod3:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1143
  add0-mod4:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1144
  add0-rm2:1:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1145
  add0-rm4:1:data0
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1146
  add0:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1147
  add0-mod1:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1148
  add0-mod2:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1149
  add0-mod3:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1150
  add0-mod4:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1151
  add0-rm1:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1152
  add0-rm2:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1153
  add0-rm4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1154
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1155
follow file history from wdir parent, unmodified in wdir:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1156
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1157
  $ hg log -f add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1158
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1159
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1160
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1161
  $ hg grep --diff -f data add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1162
  add0-mod3:3:+:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1163
  add0-mod3:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1164
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1165
  $ hg grep -f data add0-mod3
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1166
  add0-mod3:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1167
  add0-mod3:3:data3
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1168
  add0-mod3:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1169
  add0-mod3:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1170
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1171
follow file history from wdir parent, modified in wdir:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1172
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1173
  $ hg log -f add0-mod4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1174
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1175
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1176
  $ hg grep --diff -f data add0-mod4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1177
  add0-mod4:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1178
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1179
  $ hg grep -f data add0-mod4
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1180
  add0-mod4:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1181
  add0-mod4:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1182
  add0-mod4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1183
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1184
follow file history from wdir parent, copied but unmodified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1185
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1186
  $ hg log -f add0-cp1-cp3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1187
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1188
  1: A add0-cp1, A add0-cp1-mod1, A add0-cp1-mod1-rm3, M add0-mod1, R add0-rm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1189
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1190
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1191
  $ hg grep --diff -f data add0-cp1-cp3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1192
  add0:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1193
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1194
 BROKEN: should follow history across renames
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1195
  $ hg grep -f data add0-cp1-cp3
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1196
  add0-cp1-cp3:3:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1197
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1198
follow file history from wdir parent, copied and modified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1199
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1200
  $ hg log -f add0-cp1-mod1-cp3-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1201
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1202
  1: A add0-cp1, A add0-cp1-mod1, A add0-cp1-mod1-rm3, M add0-mod1, R add0-rm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1203
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1204
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1205
  $ hg grep --diff -f data add0-cp1-mod1-cp3-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1206
  add0-cp1-mod1-cp3-mod3:3:+:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1207
  add0-cp1-mod1:1:+:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1208
  add0:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1209
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1210
 BROKEN: should follow history across renames
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1211
  $ hg grep -f data add0-cp1-mod1-cp3-mod3
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1212
  add0-cp1-mod1-cp3-mod3:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1213
  add0-cp1-mod1-cp3-mod3:3:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1214
  add0-cp1-mod1-cp3-mod3:3:data3
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1215
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1216
follow file history from wdir parent, copied in wdir:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1217
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1218
  $ hg log -f add0-cp4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1219
  abort: cannot follow nonexistent file: "add0-cp4"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1220
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1221
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1222
  $ hg grep --diff -f data add0-cp4
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1223
  abort: cannot follow nonexistent file: "add0-cp4"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1224
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1225
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1226
 BROKEN: maybe better to abort
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1227
  $ hg grep -f data add0-cp4
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1228
  [1]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1229
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1230
follow file history from wdir parent, removed:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1231
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1232
  $ hg log -f add0-cp1-mod1-rm3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1233
  abort: cannot follow file not in parent revision: "add0-cp1-mod1-rm3"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1234
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1235
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1236
  $ hg grep --diff -f data add0-cp1-mod1-rm3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1237
  abort: cannot follow file not in parent revision: "add0-cp1-mod1-rm3"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1238
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1239
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1240
 BROKEN: maybe better to abort
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1241
  $ hg grep -f data add0-cp1-mod1-rm3
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1242
  add0-cp1-mod1-rm3:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1243
  add0-cp1-mod1-rm3:1:data1
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1244
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1245
follow file history from wdir parent (explicit), removed:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1246
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1247
  $ hg log -fr. add0-cp1-mod1-rm3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1248
  abort: cannot follow file not in any of the specified revisions: "add0-cp1-mod1-rm3"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1249
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1250
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1251
  $ hg grep --diff -fr. data add0-cp1-mod1-rm3
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1252
  abort: cannot follow file not in any of the specified revisions: "add0-cp1-mod1-rm3"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1253
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1254
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1255
 BROKEN: should abort
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1256
  $ hg grep -fr. data add0-cp1-mod1-rm3
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1257
  add0-cp1-mod1-rm3:1:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1258
  add0-cp1-mod1-rm3:1:data1
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1259
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1260
follow file history from wdir parent, removed in wdir:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1261
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1262
  $ hg log -f add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1263
  abort: cannot follow file not in parent revision: "add0-rm4"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1264
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1265
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1266
  $ hg grep --diff -f data add0-rm4
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1267
  abort: cannot follow file not in parent revision: "add0-rm4"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1268
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1269
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1270
 BROKEN: should abort
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1271
  $ hg grep -f data add0-rm4
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1272
  add0-rm4:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1273
  add0-rm4:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1274
  add0-rm4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1275
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1276
follow file history from wdir parent (explicit), removed in wdir:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1277
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1278
  $ hg log -fr. add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1279
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1280
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1281
  $ hg grep --diff -fr. data add0-rm4
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1282
  add0-rm4:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1283
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1284
  $ hg grep -fr. data add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1285
  add0-rm4:3:data0
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1286
  add0-rm4:1:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1287
  add0-rm4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1288
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1289
follow file history from wdir parent, multiple files:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1290
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1291
  $ hg log -f add0-mod3 add0-cp1-mod1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1292
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1293
  1: A add0-cp1, A add0-cp1-mod1, A add0-cp1-mod1-rm3, M add0-mod1, R add0-rm1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1294
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1295
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1296
  $ hg grep --diff -f data add0-mod3 add0-cp1-mod1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1297
  add0-mod3:3:+:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1298
  add0-cp1-mod1:1:+:data1
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1299
  add0:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1300
  add0-mod3:0:+:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1301
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1302
 BROKEN: should follow history across renames
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1303
  $ hg grep -f data add0-mod3 add0-cp1-mod1
45478
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1304
  add0-cp1-mod1:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1305
  add0-cp1-mod1:3:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1306
  add0-mod3:3:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1307
  add0-mod3:3:data3
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1308
  add0-cp1-mod1:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1309
  add0-cp1-mod1:1:data1
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1310
  add0-mod3:1:data0
07c424a13811 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org>
parents: 45477
diff changeset
  1311
  add0-mod3:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1312
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1313
follow file history from specified revision, modified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1314
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1315
  $ hg log -fr2 add0-mod2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1316
  2: A add0-cp2, A add0-cp2-mod2, M add0-mod2, R add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1317
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1318
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1319
  $ hg grep --diff -fr2 data add0-mod2
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1320
  add0-mod2:2:+:data2
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1321
  add0-mod2:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1322
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1323
  $ hg grep -fr2 data add0-mod2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1324
  add0-mod2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1325
  add0-mod2:2:data2
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1326
  add0-mod2:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1327
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1328
follow file history from specified revision, copied but unmodified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1329
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1330
  $ hg log -fr2 add0-cp2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1331
  2: A add0-cp2, A add0-cp2-mod2, M add0-mod2, R add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1332
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1333
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1334
  $ hg grep --diff -fr2 data add0-cp2
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1335
  add0:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1336
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1337
 BROKEN: should follow history across renames
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1338
  $ hg grep -fr2 data add0-cp2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1339
  add0-cp2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1340
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1341
follow file history from specified revision, copied and modified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1342
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1343
  $ hg log -fr2 add0-cp2-mod2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1344
  2: A add0-cp2, A add0-cp2-mod2, M add0-mod2, R add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1345
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1346
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1347
  $ hg grep --diff -fr2 data add0-cp2-mod2
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1348
  add0-cp2-mod2:2:+:data2
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1349
  add0:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1350
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1351
 BROKEN: should follow history across renames
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1352
  $ hg grep -fr2 data add0-cp2-mod2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1353
  add0-cp2-mod2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1354
  add0-cp2-mod2:2:data2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1355
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1356
follow file history from specified revision, removed:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1357
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1358
  $ hg log -fr2 add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1359
  abort: cannot follow file not in any of the specified revisions: "add0-rm2"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1360
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1361
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1362
  $ hg grep --diff -fr2 data add0-rm2
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1363
  abort: cannot follow file not in any of the specified revisions: "add0-rm2"
48553
3b6b43a7ace4 logcmdutil: raise `StateError` when file to follow doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46116
diff changeset
  1364
  [20]
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1365
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1366
 BROKEN: should abort
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1367
  $ hg grep -fr2 data add0-rm2
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1368
  add0-rm2:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1369
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1370
follow file history from specified revision, multiple files:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1371
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1372
  $ hg log -fr2 add0-cp2 add0-mod2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1373
  2: A add0-cp2, A add0-cp2-mod2, M add0-mod2, R add0-rm2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1374
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1375
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1376
  $ hg grep --diff -fr2 data add0-cp2 add0-mod2
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1377
  add0-mod2:2:+:data2
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1378
  add0:0:+:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1379
  add0-mod2:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1380
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1381
 BROKEN: should follow history across renames
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1382
  $ hg grep -fr2 data add0-cp2 add0-mod2
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1383
  add0-cp2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1384
  add0-mod2:2:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1385
  add0-mod2:2:data2
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1386
  add0-mod2:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1387
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1388
follow file history from wdir, unmodified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1389
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1390
  $ hg log -fr'wdir()' add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1391
  2147483647: A add0-cp4, A add0-cp4-mod4, M add0-mod4, R add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1392
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1393
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1394
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1395
  $ hg grep --diff -fr'wdir()' data add0-mod3
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1396
  add0-mod3:3:+:data3
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1397
  add0-mod3:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1398
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1399
  $ hg grep -fr'wdir()' data add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1400
  add0-mod3:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1401
  add0-mod3:2147483647:data3
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1402
  add0-mod3:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1403
  add0-mod3:3:data3
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1404
  add0-mod3:1:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1405
  add0-mod3:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1406
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1407
follow file history from wdir, modified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1408
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1409
  $ hg log -fr'wdir()' add0-mod4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1410
  2147483647: A add0-cp4, A add0-cp4-mod4, M add0-mod4, R add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1411
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1412
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1413
  $ hg grep --diff -fr'wdir()' data add0-mod4
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1414
  add0-mod4:2147483647:+:data4
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1415
  add0-mod4:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1416
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1417
  $ hg grep -fr'wdir()' data add0-mod4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1418
  add0-mod4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1419
  add0-mod4:2147483647:data4
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1420
  add0-mod4:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1421
  add0-mod4:1:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1422
  add0-mod4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1423
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1424
follow file history from wdir, copied but unmodified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1425
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1426
  $ hg log -fr'wdir()' add0-cp4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1427
  2147483647: A add0-cp4, A add0-cp4-mod4, M add0-mod4, R add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1428
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1429
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1430
  $ hg grep --diff -fr'wdir()' data add0-cp4
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1431
  add0:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1432
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1433
 BROKEN: should follow history across renames
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1434
  $ hg grep -fr'wdir()' data add0-cp4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1435
  add0-cp4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1436
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1437
follow file history from wdir, copied and modified:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1438
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1439
  $ hg log -fr'wdir()' add0-cp4-mod4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1440
  2147483647: A add0-cp4, A add0-cp4-mod4, M add0-mod4, R add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1441
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1442
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1443
  $ hg grep --diff -fr'wdir()' data add0-cp4-mod4
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1444
  add0-cp4-mod4:2147483647:+:data4
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1445
  add0:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1446
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1447
 BROKEN: should follow history across renames
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1448
  $ hg grep -fr'wdir()' data add0-cp4-mod4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1449
  add0-cp4-mod4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1450
  add0-cp4-mod4:2147483647:data4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1451
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1452
follow file history from wdir, multiple files:
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1453
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1454
  $ hg log -fr'wdir()' add0-cp4 add0-mod4 add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1455
  2147483647: A add0-cp4, A add0-cp4-mod4, M add0-mod4, R add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1456
  3: A add0-cp1-cp3, A add0-cp1-mod1-cp3-mod3, R add0-cp1-mod1-rm3, M add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1457
  0: A add0, A add0-mod1, A add0-mod2, A add0-mod3, A add0-mod4, A add0-rm1, A add0-rm2, A add0-rm4
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1458
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1459
  $ hg grep --diff -fr'wdir()' data add0-cp4 add0-mod4 add0-mod3
45650
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1460
  add0-mod4:2147483647:+:data4
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1461
  add0-mod3:3:+:data3
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1462
  add0:0:+:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1463
  add0-mod3:0:+:data0
0356b41fe01d cmdutil: rewrite walkchangerevs() by using logcmdutil functions
Yuya Nishihara <yuya@tcha.org>
parents: 45480
diff changeset
  1464
  add0-mod4:0:+:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1465
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1466
 BROKEN: should follow history across renames
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1467
  $ hg grep -fr'wdir()' data add0-cp4 add0-mod4 add0-mod3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1468
  add0-cp4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1469
  add0-mod3:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1470
  add0-mod3:2147483647:data3
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1471
  add0-mod4:2147483647:data0
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1472
  add0-mod4:2147483647:data4
45480
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1473
  add0-mod3:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1474
  add0-mod3:3:data3
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1475
  add0-mod4:3:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1476
  add0-mod3:1:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1477
  add0-mod4:1:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1478
  add0-mod3:0:data0
8ceb5b4b2728 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 45478
diff changeset
  1479
  add0-mod4:0:data0
45477
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1480
20dd2a259b0f test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org>
parents: 45430
diff changeset
  1481
  $ cd ..