views:

81

answers:

2

The $Revision$ in CVS shows the version of a file, which based on modification count.

This is very convienient, as the modification count can be used as "Build Number", and for each file, the number itself reflects the "growing life" of a file.

But in SVN, the version is about the whole repository, any modification to files are by means of "atom operation" to the whole repository, so if the repository version is 342912, and a new file is created, then that file has a start revision number of 342912, not 1 which is more intuitive.

You can always get the modification count by

FILE_BUILD_NUMBER = `svn log -q FILE | grep r | wc -l`

But this is not efficient and it's rather time cosuming. It should be easy to implement in the subversion by just add an modified-count field in the repository, and increment each time a file is commited. So, is this feature already implemented? Is there a svn:keyword to expand that?

+3  A: 

The short answer: No.

Thomas Weller
+1  A: 

No, this undermines the idea of SVN repository-level revisions. Actually, the revision number from Subversion is more helpful, because it gives you a number to identify the state of the entire repository, not just that file. You just have to accept that (1) rev numbers are not always going to increment by 1, and (2) rev numbers will not start at 1.

(It helps to think of the SVN rev number as a "timestamp".)

msemack
Agree. The OP's world view is skewed. A program (usually!) is not a single file, but a large collection of files. The number of revisions of one file is irrelevant. A unique, incrementing number identifying your complete project state is much more interesting.
Trevor Harrison