Patchwork D4157: grep: search all commits in allfiles mode

login
register
mail settings
Submitter phabricator
Date Aug. 9, 2018, 1:01 p.m.
Message ID <d9c7af47097d7aabfd302cff9b286ed6@localhost.localdomain>
Download mbox | patch
Permalink /patch/33448/
State Not Applicable
Headers show

Comments

phabricator - Aug. 9, 2018, 1:01 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd99468d2b09a: grep: search all commits in allfiles mode (authored by sangeet259, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4157?vs=10077&id=10099

REVISION DETAIL
  https://phab.mercurial-scm.org/D4157

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-grep.t

CHANGE DETAILS




To: sangeet259, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-grep.t b/tests/test-grep.t
--- a/tests/test-grep.t
+++ b/tests/test-grep.t
@@ -500,4 +500,8 @@ 
   $ hg grep -r "0:2" "unmod" --all-files
   um:0:unmod
   um:1:unmod
+  $ hg grep -r "0:2" "unmod" --all-files um
+  um:0:unmod
+  um:1:unmod
   $ cd ..
+
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1899,7 +1899,7 @@ 
     # wanted: a cache of filenames that were changed (ctx.files()) and that
     # match the file filtering conditions.
 
-    if match.always():
+    if match.always() or allfiles:
         # No files, no patterns.  Display all revs.
         wanted = revs
     elif not slowpath: