grep: make multiline mode the default (BC)
This is a much more logical way to deal with ^ and $.
Old ^ and $ behavior are available with \A and \Z.
--- a/mercurial/commands.py Mon Jan 02 20:52:16 2012 -0600
+++ b/mercurial/commands.py Tue Jan 03 15:48:58 2012 -0600
@@ -2663,7 +2663,7 @@
Returns 0 if a match is found, 1 otherwise.
"""
- reflags = 0
+ reflags = re.M
if opts.get('ignore_case'):
reflags |= re.I
try:
--- a/tests/test-grep.t Mon Jan 02 20:52:16 2012 -0600
+++ b/tests/test-grep.t Tue Jan 03 15:48:58 2012 -0600
@@ -59,8 +59,9 @@
follow
- $ hg grep --traceback -f 'import$' port2
+ $ hg grep --traceback -f 'import\n\Z' port2
port:0:import
+
$ echo deport >> port2
$ hg commit -m 5 -u eggs -d '6 0'
$ hg grep -f --all -nu port port2