comparison tests/test-grep.t @ 39930:66df1059b7c0

grep: rename {line_number} to {lineno} as well (BC)
author Yuya Nishihara <yuya@tcha.org>
date Sun, 30 Sep 2018 15:37:09 +0900
parents 5abc47d4ca6b
children 718e9b444d97
comparison
equal deleted inserted replaced
39929:47cb6750dea3 39930:66df1059b7c0
62 62
63 $ hg grep -r tip:0 -Tjson port 63 $ hg grep -r tip:0 -Tjson port
64 [ 64 [
65 { 65 {
66 "date": [4, 0], 66 "date": [4, 0],
67 "line_number": 1, 67 "lineno": 1,
68 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", 68 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
69 "path": "port", 69 "path": "port",
70 "rev": 4, 70 "rev": 4,
71 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], 71 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
72 "user": "spam" 72 "user": "spam"
73 }, 73 },
74 { 74 {
75 "date": [4, 0], 75 "date": [4, 0],
76 "line_number": 2, 76 "lineno": 2,
77 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", 77 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
78 "path": "port", 78 "path": "port",
79 "rev": 4, 79 "rev": 4,
80 "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], 80 "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
81 "user": "spam" 81 "user": "spam"
82 }, 82 },
83 { 83 {
84 "date": [4, 0], 84 "date": [4, 0],
85 "line_number": 3, 85 "lineno": 3,
86 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", 86 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
87 "path": "port", 87 "path": "port",
88 "rev": 4, 88 "rev": 4,
89 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], 89 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
90 "user": "spam" 90 "user": "spam"
95 95
96 $ hg grep -r tip:0 -Tjson -l port 96 $ hg grep -r tip:0 -Tjson -l port
97 [ 97 [
98 { 98 {
99 "date": [4, 0], 99 "date": [4, 0],
100 "line_number": 1, 100 "lineno": 1,
101 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", 101 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
102 "path": "port", 102 "path": "port",
103 "rev": 4, 103 "rev": 4,
104 "user": "spam" 104 "user": "spam"
105 } 105 }
123 $ hg grep --all -Tjson port port 123 $ hg grep --all -Tjson port port
124 [ 124 [
125 { 125 {
126 "change": "-", 126 "change": "-",
127 "date": [4, 0], 127 "date": [4, 0],
128 "line_number": 4, 128 "lineno": 4,
129 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", 129 "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
130 "path": "port", 130 "path": "port",
131 "rev": 4, 131 "rev": 4,
132 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], 132 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
133 "user": "spam" 133 "user": "spam"
134 }, 134 },
135 { 135 {
136 "change": "+", 136 "change": "+",
137 "date": [3, 0], 137 "date": [3, 0],
138 "line_number": 4, 138 "lineno": 4,
139 "node": "95040cfd017d658c536071c6290230a613c4c2a6", 139 "node": "95040cfd017d658c536071c6290230a613c4c2a6",
140 "path": "port", 140 "path": "port",
141 "rev": 3, 141 "rev": 3,
142 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], 142 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
143 "user": "eggs" 143 "user": "eggs"
144 }, 144 },
145 { 145 {
146 "change": "-", 146 "change": "-",
147 "date": [2, 0], 147 "date": [2, 0],
148 "line_number": 1, 148 "lineno": 1,
149 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", 149 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
150 "path": "port", 150 "path": "port",
151 "rev": 2, 151 "rev": 2,
152 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], 152 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
153 "user": "spam" 153 "user": "spam"
154 }, 154 },
155 { 155 {
156 "change": "-", 156 "change": "-",
157 "date": [2, 0], 157 "date": [2, 0],
158 "line_number": 2, 158 "lineno": 2,
159 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", 159 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
160 "path": "port", 160 "path": "port",
161 "rev": 2, 161 "rev": 2,
162 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], 162 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
163 "user": "spam" 163 "user": "spam"
164 }, 164 },
165 { 165 {
166 "change": "+", 166 "change": "+",
167 "date": [2, 0], 167 "date": [2, 0],
168 "line_number": 1, 168 "lineno": 1,
169 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", 169 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
170 "path": "port", 170 "path": "port",
171 "rev": 2, 171 "rev": 2,
172 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], 172 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
173 "user": "spam" 173 "user": "spam"
174 }, 174 },
175 { 175 {
176 "change": "+", 176 "change": "+",
177 "date": [2, 0], 177 "date": [2, 0],
178 "line_number": 2, 178 "lineno": 2,
179 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", 179 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
180 "path": "port", 180 "path": "port",
181 "rev": 2, 181 "rev": 2,
182 "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], 182 "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
183 "user": "spam" 183 "user": "spam"
184 }, 184 },
185 { 185 {
186 "change": "+", 186 "change": "+",
187 "date": [2, 0], 187 "date": [2, 0],
188 "line_number": 3, 188 "lineno": 3,
189 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", 189 "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
190 "path": "port", 190 "path": "port",
191 "rev": 2, 191 "rev": 2,
192 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], 192 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
193 "user": "spam" 193 "user": "spam"
194 }, 194 },
195 { 195 {
196 "change": "+", 196 "change": "+",
197 "date": [1, 0], 197 "date": [1, 0],
198 "line_number": 2, 198 "lineno": 2,
199 "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587", 199 "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587",
200 "path": "port", 200 "path": "port",
201 "rev": 1, 201 "rev": 1,
202 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], 202 "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
203 "user": "eggs" 203 "user": "eggs"
204 }, 204 },
205 { 205 {
206 "change": "+", 206 "change": "+",
207 "date": [0, 0], 207 "date": [0, 0],
208 "line_number": 1, 208 "lineno": 1,
209 "node": "f31323c9217050ba245ee8b537c713ec2e8ab226", 209 "node": "f31323c9217050ba245ee8b537c713ec2e8ab226",
210 "path": "port", 210 "path": "port",
211 "rev": 0, 211 "rev": 0,
212 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], 212 "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
213 "user": "spam" 213 "user": "spam"
479 479
480 $ hg grep "some" -Tjson 480 $ hg grep "some" -Tjson
481 [ 481 [
482 { 482 {
483 "date": [0, 0], 483 "date": [0, 0],
484 "line_number": 1, 484 "lineno": 1,
485 "node": "ffffffffffffffffffffffffffffffffffffffff", 485 "node": "ffffffffffffffffffffffffffffffffffffffff",
486 "path": "file2", 486 "path": "file2",
487 "rev": 2147483647, 487 "rev": 2147483647,
488 "texts": [{"matched": true, "text": "some"}, {"matched": false, "text": " text"}], 488 "texts": [{"matched": true, "text": "some"}, {"matched": false, "text": " text"}],
489 "user": "test" 489 "user": "test"