Given a file, how do I find out number of times the file was revised? The head revision number may be in hundreds but I would have revised a file just 4 times. Thus given that file, I want 4 as the answer. Sounds pretty trivial but I was unable to find any command to achieve this. Can someone help?
-1 count is wrong, should have tested this first ... svn log is more verbose than you think
basszero
2009-06-10 14:54:21
You're right, corrected id. Thanks.
Robert Munteanu
2009-06-10 15:00:39
A:
I'm fairly certain Subversion contains a View History mechanism within the Repo Browser.
Are you using Tortoise with Subversion?
Jack Marchetti
2009-06-10 14:45:22
Subversion itself doesn't have a repo browser — you must be thinking of features in TortoiseSVN (http://tortoisesvn.tigris.org).
Quinn Taylor
2009-06-11 06:07:04
+2
A:
The Subversion book explains:
You can also examine the log history of a single file or directory. For example:
$ svn log foo.c
$ svn log http://foo.com/svn/trunk/code/foo.c
These will display log messages only for those revisions in which the working file (or URL) changed.
Full description of the log command is here.
JeffH
2009-06-10 14:48:04
+4
A:
svn log FOO.C -q | grep -c r
svn log -q
prints summary information for the given file or directory in the log, and grep -c r
counts the number of lines containing the letter "r" (basically we just want to ignore the spacer lines "--------")
Eli
2009-06-10 14:48:20
Agreed, doing the count in grep is a nice touch. However, using the pattern '^r' is probably a better idea, so it only matches lines that start with r, which is faster since it doesn't have to search the entire ---- line to know it doesn't match. Also, I generally put the option flags before the main argument (in this case, the filename) but that's a matter of style.
Quinn Taylor
2009-06-11 06:12:16