[PATCH 0 of 2] fast manifest based grep

Matt Mackall mpm at selenic.com
Sun May 16 11:17:14 CDT 2010


On Sat, 2010-05-15 at 23:45 -0500, Steve Borho wrote:
> >> 1) No longer report a revision number by default
> >
> > How do we get them back?
> 
> By asking for annotation data.  Any use of 'user', 'date', 'follow',
> 'rev', or 'all' will fall back to the filerev search routine that
> outputs a revision field.

Ok, it seems there's no way to get back to precisely the current default
behavior (however silly it is), is that correct? Annotate uses -n to
show a number.

If we're going to change this command's behavior, I think we're going to
need to rethink the whole thing: I only want to break it once. What does
an ideal grep command that's a superset of the current and proposed
functionality look like?

Some requirements:

- should be able to search working copy or single csets
- should be fast by default
- should be able to search all of history
- should be able to annotate results meaningfully in both modes

This last is mostly about reporting revision numbers (and dates and
authors) in a useful way. Our choices are:

- show last cset where file was changed (usually meaningless)
- show latest revision pattern appears in (redundant on single cset
searches)
- show cset where pattern introduced (slow)

The last basically means calling annotate on each file with a match.
Which is slow, but it's fast when your next step would be manually
running annotate.

(Also, your patch breaks -a.)

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list