I've tried all kinds of stuff, and there is only one tool that does it right: SubWCRev.exe from TortoiseSVN.
svn info, svnversion are all jokes and don't provide good results (so, please don't post replies involving these unless you are sure that they can do that).
I work on a huge project and I maintain buildserver for our project. The buildserver does sparse checkout (e.g. only some of the folders are checked out that are actually used by our project). My goal is simple: i don't want my version number to bump up if somebody modifies files in other branches or folders that aren't part my sparse checkout. Basically, my goal is to ensure that identical input files will generate identical build results (e.g. embedded svn number should be the same).
SubWCRev from tortoise does exactly this job and reports last committed revision of all the files that are checked out.
svnversion -cn for example is a close try, but it doesn't work properly.
Imagine I have this structure:
trunk
|
+-src
+-include
+-lib
|
+-Win32
+-Linux
+-WinRT
lib folder contains libraries for different OS'es and platforms. For example, Win32 is over a gig in size and on linux box we do sparse checkout e.g. svn update --set-depth=exclude trunk/lib/Win32 this way on my linux buildserver I don't even see trunk/lib/Win32. The problem with svnversion -c is that it reports last committed rev even in sub-folders that are excluded. So, is there a tool that behaves like SubWCRev from tortoise svn (I don't care for it's capability to substitute tags in files, all I need is the last commited version number that it extracts properly).