diff tests/test-grep.t @ 38342:b8f45fc27370

grep: adds allfiles mode Adds an allfiles flag that lets you grep on all files in the revision and not just the one that were modified in that changeset. This would work on a single revision and get all the files that were there in that revision. So it's like grepping on a previous state. Using this with wdir() :: `hg grep -r "wdir()" --allfiles` is what the default behavior is desired for grep. Support for multiple revisions to be added later. Differential Revision: https://phab.mercurial-scm.org/D3728
author Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
date Wed, 13 Jun 2018 16:22:54 +0530
parents 16f93a3b8b05
children 7fbb5d76c555
line wrap: on
line diff
--- a/tests/test-grep.t	Wed Jun 13 22:50:32 2018 +0530
+++ b/tests/test-grep.t	Wed Jun 13 16:22:54 2018 +0530
@@ -372,6 +372,23 @@
 
   $ cd ..
 
+Test for showing working of allfiles flag
+
+  $ hg init sng
+  $ cd sng
+  $ echo "unmod" >> um
+  $ hg ci -A -m "adds unmod to um"
+  adding um
+  $ echo "something else" >> new
+  $ hg ci -A -m "second commit"
+  adding new
+  $ hg grep -r "." "unmod"
+  [1]
+  $ hg grep -r "." "unmod" --allfiles
+  um:1:unmod
+
+  $ cd ..
+
 Fix_Wdir(): test that passing wdir() t -r flag does greps on the
 files modified in the working directory