# HG changeset patch # User Matt Mackall # Date 1325627338 21600 # Node ID 1ef46bcd76f800776c9582e1eb27a03374e9d8b1 # Parent c8cd3c4bf9a41a4e8c6e36568e77e4d8d39b2be0 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. diff -r c8cd3c4bf9a4 -r 1ef46bcd76f8 mercurial/commands.py --- 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: diff -r c8cd3c4bf9a4 -r 1ef46bcd76f8 tests/test-grep.t --- 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