subwcrev for linux equivalent
#1
I'd like to ask our *nix teammembers if they know of a good program that can mimic the subwcrev utility and runs on their *nix.

I'd like to include the revision number in the MCS build; I'd use subwcrev for Windows builds, but have no idea about *nix builds. Would anyone suggest a reasonable solution?

Thanks.
Reply
Thanks given by:
#2
Take a look at: http://svnwcrev.tigris.org

It's supposed to be a "port" of subwcrev for *nix. I don't know which state it's in but I'm betting that if you only need the revision number then it'll work just fine.

(You could also do a "svn info" and then parse output...)
----------

As MCS is using GNU make the following might be just right for this task:
http://subversion.apache.org/faq.html#ve...-in-source
Reply
Thanks given by:
#3
From what I've read, svnwcrev is not maintained and may be unusable for svn 1.7 repositories. Can you try it out? Ideally try to make it work on the $/Install/WCVersion.cmd.template file and see if what you get (should be "set WCREV=328").
Also, if it works, can you provide instructions for us non-*nixers to get it working? Smile
Reply
Thanks given by:
#4
I've attached a couple of diff-files (created using svn diff; renamed to get them attached thos post) which changes the GNUmakefile and cServer.cpp. This shows how the svn-information is generated at compile-time and how it is to be used in the code Wink

I hope this is what you are looking for?


Attached Files
.txt   cServer.cpp.diff.txt (Size: 432 bytes / Downloads: 367)
.txt   GNUmakefile.diff.txt (Size: 604 bytes / Downloads: 373)
Reply
Thanks given by:
#5
Not exactly what I had in mind, but close enough.

I can't do a similar thing for windows, so instead I need the svnversion or whatever tool to process a file, WCVersion.h, that only contains the SVN revision number defined as a macro. On Windows, I can make that file a .template and it will be automagically processed into the correct header by subwcrev; I'm looking for a similar way in *nix. Thus:

WCVersion.h.template contents:
#define WCREV $WCREV$

From that, subwcrev generates WCVersion.h:
#define WCREV 340

Whichever file in the project needs the revision number, just does an #include "WCVersion.h"

Can this be done easily on *nix?
Reply
Thanks given by:
#6
I'm not a makefile specialist. If you put this in the GNUmakefile WCVersion.h gets generated with the info but I don't know where to put it in GNUMakefile to get it to work everytime...

Code:
WCVersion.h:
        @rm -f WCVersion.h
        @echo -ne "#define WCREV " > WCVersion.h
        @svnversion -n . >> WCVersion.h
Reply
Thanks given by:
#7
I'd prefer something that could actually replace things in WCVersion.h, rather than synthetizing it from scratch. If we ever decide to put something else into the file (such as last commit's date etc.)
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)