tags:

views:

144

answers:

3

hi,

I want to display svn revision number to a text file I am getting the revision number using this command $revision = ([xml](svn info "filepath" --xml)).info.entry.commit.revision

+2  A: 

If the text file is under source control you might find it easier to investigate svn:keywords. The SVN book will tell you how to use them.

If the text file is not under source control, could you be more explicit about what you are trying to do.

High Performance Mark
The text file is not under source control.Mainly I want to display the version number in a corner in my website. After writing it to a text file I can retrieve it using c# and display it.If there is any other way of displaying the revision number without writing it text file please let me know.
shanthiram
I'd recommend putting the text file, even if it contains only the revision number, under source control. But @newtover's answer will do what you want so you decide.
High Performance Mark
A: 

Assuming that you will read the value from c# and can throw out the prefix:

svn info somefile.txt | find "Revision" > revision.txt
newtover
Thank you newtover.
shanthiram
A: 

The easiest way is to use the svnversion program that comes with Subversion.

As the documentation says,

It's common to use this output in your build process when defining the version number of your program.

svnversion -c gives you the latest committed version.

R. Bemrose
Where can I download this program. I tried svnversion command and its not recognized.
shanthiram