[Bug 4158] New: grep --all doesn't report pattern disappearing when a file is removed

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Sun Feb 2 16:29:12 CST 2014


http://bz.selenic.com/show_bug.cgi?id=4158

          Priority: normal
            Bug ID: 4158
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: grep --all doesn't report pattern disappearing when a
                    file is removed
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: dovdevel at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.8.2
         Component: Mercurial
           Product: Mercurial

hg grep --all normally records the disappearance of a pattern:

$ hg init
$ echo hello > a.txt
$ hg com -A -m "added hello"
adding a.txt
$ echo there >> a.txt
$ hg com -m "added there"
$ echo hello > a.txt
$ hg com -m "removed there"
$ hg grep --all there
a.txt:2:-:there
a.txt:1:+:there

However, if a pattern disappears because the entire file containg it was
removed, hg grep --all doesn't seem to pick that up:

$ hg rm a.txt
$ hg com -m "removed a.txt"
$ hg grep --all hello
a.txt:0:+:hello
$

This is important when a function which is not referenced anywhere in the
codebase is discovered, and I want to find out when it was last referenced.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list