Mercurial > hg
comparison tests/test-grep.t @ 38217:16f93a3b8b05
grep: enable passing wdir as a revision
When you pass wdir() to the -r flag, it catches the WdirUnsupported error
and falls back to an alternate path.
Differential Revision: https://phab.mercurial-scm.org/D3673
author | Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com> |
---|---|
date | Wed, 30 May 2018 17:37:17 +0530 |
parents | 31750413f8d7 |
children | b8f45fc27370 |
comparison
equal
deleted
inserted
replaced
38216:22edd5321489 | 38217:16f93a3b8b05 |
---|---|
248 $ hg up -q | 248 $ hg up -q |
249 $ echo wport >> port2 | 249 $ echo wport >> port2 |
250 $ hg stat | 250 $ hg stat |
251 M port2 | 251 M port2 |
252 $ hg grep -r 'wdir()' port | 252 $ hg grep -r 'wdir()' port |
253 abort: working directory revision cannot be specified | 253 port2:2147483647:export |
254 [255] | 254 port2:2147483647:vaportight |
255 port2:2147483647:import/export | |
256 port2:2147483647:deport | |
257 port2:2147483647:wport | |
255 | 258 |
256 $ cd .. | 259 $ cd .. |
257 $ hg init t2 | 260 $ hg init t2 |
258 $ cd t2 | 261 $ cd t2 |
259 $ hg grep foobar foo | 262 $ hg grep foobar foo |
366 $ hg ci -m 'add binfile.bin' | 369 $ hg ci -m 'add binfile.bin' |
367 $ hg grep "MaCam" --all | 370 $ hg grep "MaCam" --all |
368 binfile.bin:0:+: Binary file matches | 371 binfile.bin:0:+: Binary file matches |
369 | 372 |
370 $ cd .. | 373 $ cd .. |
374 | |
375 Fix_Wdir(): test that passing wdir() t -r flag does greps on the | |
376 files modified in the working directory | |
377 | |
378 $ cd a | |
379 $ echo "abracadara" >> a | |
380 $ hg add a | |
381 $ hg grep -r "wdir()" "abra" | |
382 a:2147483647:abracadara | |
383 | |
384 $ cd .. |