HomePhabricator

grep: change default behaviour to search working directory files (BC)

Authored by sangeet259.

Description

grep: change default behaviour to search working directory files (BC)

With this patch, grep searches on the working directory by default
and looks for all files tracked by the working directory and greps on them.

OLD BEHAVIOUR

$ hg init a
$ cd a
$ echo "some text">>file1
$ hg add file1
$ hg commit -m "adds file1"
$ hg mv file1 file2
$ hg grep "some"
file2:1:some text
file1:0:some text

This behaviour is undesirable since file1 is not in the current history and was
renamed as file2, so the second result was redundant and confusing.

NEW BEHAVIOUR

$ hg init a
$ cd a
$ echo "some text">>file1
$ hg add file1
$ hg commit -m "adds file1"
$ hg mv file1 file2
$ hg grep "some"
file2:2147483647:some text

Differential Revision: https://phab.mercurial-scm.org/D3826

Details

Committed
sangeet259Jul 5 2018, 3:09 PM
Differential Revision
D3826: grep: change default behaviour of grep
Parents
rHGe1987261dd05: patch: don't separate \r and \n when colorizing diff output
Branches
Unknown
Tags
Unknown