View previous topic :: View next topic |
Author |
Message |
mds
Joined: 06 Nov 2005 Posts: 29
|
embed subversion number in code as a string |
Posted: Mon Feb 21, 2011 7:55 pm |
|
|
HI,
A little new to subversion and such. I'm trying to embed the subversion commit number as a string in my ccs code.
Code: | #define ver_str "v2.00" |
this snip is what I have been using and manually updating.
subversion recognises keywords
$Revision$ placed in a text file for example is replaced with
$Revision 17$ after a commit. 17 being the 17th commit in this eg.
so I tried
Code: | #define ver_str "$Revision$" |
This, as expected, gets replaced with
Code: | #define ver_str "$Revision: 17" | after a commit
I would like to remove the text word Revision. Thus rendering ver_str as "17" ie only the number part.
any ideas? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 22, 2011 1:38 pm |
|
|
Quote: | subversion recognises keywords |
Is this statement from a CCS manual or User's Guide ? Post a link to it.
What's a commit ? Does it mean 'compiled' ? Or 'programmed' ?
I have the feeling that you're using some product other than CCS
and it has its own documentation that we haven't seen. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Feb 22, 2011 4:59 pm |
|
|
The post is expecting basic knowledge of subversion, a free/open source version control system. See http://subversion.apache.org |
|
|
mds
Joined: 06 Nov 2005 Posts: 29
|
|
Posted: Tue Feb 22, 2011 9:12 pm |
|
|
Yes my mistake. I was expecting prior knowledge of subversion. I anticipated that most coders would be using something similar?
With multiple projects and release versions we are beginning to have problems with bug and issue tracking. I'm looking at automated systems.
My question was whether CCS could somehow parse or deal with such things. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Feb 23, 2011 12:16 am |
|
|
I didn't exactly understand, where you want to use the information from the version string. Inside the application code? It should work with C string processing and thus consume resources at run-time. The CCS C preprocessor doesn't have the features to perform text processing. |
|
|
mds
Joined: 06 Nov 2005 Posts: 29
|
|
Posted: Wed Feb 23, 2011 6:08 pm |
|
|
HI,
Yes, in the application code.
for eg Somewhere in the code I would have this.
Code: | printf("%s",ver_str); |
Your last sentence pretty much kills the idea tho:( If the pre-processor has no provision for processing such things I'll have to resort to manual labour :( |
|
|
|