diff 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
line wrap: on
line diff
--- a/tests/test-grep.t	Fri Jun 01 23:33:17 2018 -0400
+++ b/tests/test-grep.t	Wed May 30 17:37:17 2018 +0530
@@ -250,8 +250,11 @@
   $ hg stat
   M port2
   $ hg grep -r 'wdir()' port
-  abort: working directory revision cannot be specified
-  [255]
+  port2:2147483647:export
+  port2:2147483647:vaportight
+  port2:2147483647:import/export
+  port2:2147483647:deport
+  port2:2147483647:wport
 
   $ cd ..
   $ hg init t2
@@ -368,3 +371,14 @@
   binfile.bin:0:+: Binary file matches
 
   $ cd ..
+
+Fix_Wdir(): test that passing wdir() t -r flag does greps on the
+files modified in the working directory
+
+  $ cd a
+  $ echo "abracadara" >> a
+  $ hg add a
+  $ hg grep -r "wdir()" "abra"
+  a:2147483647:abracadara
+
+  $ cd ..