Always Commit the same file with SVN *

Question

In my web application I have a file which hold the current revision number via $Rev$. This work fine except, if I don't make any changes to that file, it doesn't get committed.

Is there anyway I can force a single file to always get committed to the SVN server?

I'm using TortoiseSVN for Windows so any code or step-by-step instructions would be helpful.

Answer

If you have TortoiseSVN installed, you also have the SubWCRev tool available. Use that tool to get the revision instead of misusing the $REV$ keyword.

  1. create a template file which contains your defines, maybe something like

    const long WC_REV = $WCREV$;

    in a file named version.h.tmpl

  2. on every build, call SubWCRev to create the 'real' file you can use in your application:

    SubWCRev path\to\workingcopy path\to\version.h.tmpl path\to\version.h

This will create the file version.h from version.h.tmpl, with the text $WCREV$ replaced with the revision your working copy is currently at.

The docs for SubWCRev might help too.

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/5948/" >Always Commit the same file with SVN< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment