grep: restore pre-
9ef10437bb88 behavior, enable wdir search by tweakdefaults
Unfortunately, python-hglib relies on the original grep behavior and is
documented as such. Even though we agreed to introduce the BC, we shouldn't
break existing libraries.
So this patch flips the default again and move the new default to
ui.tweakdefaults. We could instead use HGPLAIN to turn this flag off, but
that would be rather confusing as the old/new behaviors are quite different.
Differential Revision: https://phab.mercurial-scm.org/D3919
grep: add config knob to enable/disable the default wdir search
This allows us to conditionally enable the new behavior to unbreak
python-hglib. See the next patch.
The config option is undocumented since the --all-files is still experimental
and isn't fully implemented. It can be moved to [experimental] if that's
preferred.
Differential Revision: https://phab.mercurial-scm.org/D3918
grep: search working directory files by default if --all-files is specified
The default was -rtip:0 before, but "--all-files -rtip:0" would be the most
useless combination, and it isn't supported yet. Let's change the default to
something useful.
This isn't flagged as BC since --all-files isn't released.
Differential Revision: https://phab.mercurial-scm.org/D3917
grep: reject --diff --all-files
This combination doesn't make any sense since --diff is the flag to search
change history, whereas --all-files is to include unmodified contents.
Differential Revision: https://phab.mercurial-scm.org/D3916
grep: rename --allfiles to --all-files
This matches the config name to be added.
Note that we don't have to keep the old flag since it isn't released yet.
Differential Revision: https://phab.mercurial-scm.org/D3915
debugdeltachain: protect against 0 readsize
If you don't read any data, read density should be 1.