I wonder how to deal with the RN (revision number) in my software project.
The RN is placed in a separate header file and is shown in the about view and looks something like this: v1.23.456
Normally I crate a tag like this:
1. Create the tag by:
svn copy http://myrepo/trunk http://myrepo/tags/1.23.456 -m"Tagged version 1.23.456"
2. Check out the tag and edit the RN:
svn co http://myrepo/tags/1.23.456
gedit revisionNumber.h
3. Check in the adapted RN:
svn ci revisionNumber.h -m"Adadpted RN"
--> It is a bad workaround to edit a tag. But I don not know another way to manage the RN. So my question is:
How to manage revision numbering in a SVN tag?
You can do it one of two ways, depending on how you are building your released software.
revisionNumber.h
before you tag.revisionNumber.h
is correct (it matches the tag). You can implement this in the post-commit hook using svnlook cat
and grep
.The downside of this approach is that you still have to update the revision number in two places, but the post-commit hook at least makes sure you don't screw up.
This only applies if you have a build bot or build process.
svn copy
command to a tags folder.revisionNumber.h
and produces the build.In this approach, revisionNumber.h
is never updated in your repository and so the version number is probably invalid most of the time. If you have code that depends on the revision number (i.e., it isn't for display only) this may not be a good solution.