Bug 3050 - hg grep when a file has no newline at the end.
Summary: hg grep when a file has no newline at the end.
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-15 09:31 UTC by John Lenz
Modified: 2012-05-13 04:53 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Lenz 2011-10-15 09:31 UTC
Try

$ echo 'ABC' > foo
$ echo -n 'DEF' >> foo
$ hg add foo
$ hg ci -m "add foo"
$ hg grep A
foo:1:ABC
$ hg grep D
foo:1:DE

notice the missing F.  Seems like mercurial is eating the last character
when the file does not end in a newline.
Comment 1 HG Bot 2011-10-17 23:00 UTC
Fixed by http://selenic.com/repo/hg/rev/0e34699d6988
Mads Kiilerich <mads@kiilerich.com>
grep: correct handling of matching lines without line ending (issue3050)

(please test the fix)
Comment 2 John Lenz 2011-10-18 17:44 UTC
Yes, the fix works even with my more complicated repository.  Thanks
Comment 3 Bugzilla 2012-05-12 09:24 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:24 EDT  ---

This bug was previously known as _bug_ 3050 at http://mercurial.selenic.com/bts/issue3050