views:

623

answers:

3

If I want to essentially grep every line ever in the repository, is there a way to do it? I know this would take a long time for large projects.

If not all inclusive, at least just the current branch and its entire source history?

Edit: I should have been more explicit. What if I don't have direct access to the server that the CVS repository is on? So I couldn't directly grep the filesystem that has the CVS repository.

+1  A: 

It depends on what you're looking for. CVS version files contain all of the edits that have ever happened to the file, in plaintext. So if you're simply looking for all files that contain a particular word, do a recursive grep on the repository.

If you're looking to find specific versions that contain those words, then you're going to have to extract the versions from the repository, which is expensive. However, if you can limit the set of files by grepping the repository, then it's not so bad.

kdgregory
A: 

That is not related to you Q, but let me just ask - why do you use CVS? Isn't it pretty obsolete stuff? Try to take a look at the Subversion or Perforce...

Zorkus
Trust me. It's not by choice.
Keith Bentrup
+1  A: 

There is no way to do this with standard CVS tools without access to the repository. A third party tool out there may do it (I don't know of one, although CS-CVS seems to claim to), but to do it programatically, you would have to do CVS logs on all the relevant files, and then retrieve and search each version reported by cvs in the logs (cvs log is a command line option in CVS that shows you the revision history of any file, but it doesn't show you the contents).

Yishai
+1, thx. Good to know.
Keith Bentrup