How to dynamically display the version of SVN on a website?

My website is a proven version of SVN repo. I mean, the .svn folders are hosted on the web server. I do not use web publishing.

And I want to display the current version of the project (the entire website) in the footer. How can i do this?

If I were using web publishing, I could determine the version for the assembly / publication and write it as static html.

So how to get the audit dynamically? Read .svn files directly? Are there any better ways?

I saw other such questions, but the answer used SubWCRev.exe, which, unfortunately, is unacceptable.

Edit: Tarn gave an interesting idea about SVN bindings to commit. Any other ideas?

+6
svn revision
source share
5 answers

You can write hooks for SVN. You can write a hook to update the file with the current assembly as part of the verification process. Then you can read, cache and display this build number on your site.

+2
source share

Use keyword substitution . enable substitution for the files you want to display revision information and place a keyword there, for example $Revision: 144 $ .

note that

$ Rev $ expands to show the last one in which the file was changed, not the last revision by which it was updated

(see link above). if you want to show the version number of the global repository, it is better to use svnversion .

also see the Related section.

+8
source share

If you want to display the latest version number of your entire / repository or branch, replacing the keyword will not help, I think the best solution would be to use construction / continuous integration management software like CruiseControl.NET or TeamCity with a good script construct.

Duplicate:

  • How to synchronize SVN version number with my ASP.NET website?
  • ASP.NET Display SVN Revision Number
+1
source share

There is a discussion in this previous question about SO that may be useful to you: Always commit the same file with SVN .

I always did this by running a script that would use sed to replace the comment with the current timestamp in my $ Rev $ file. Thus, the contents of the file will change, and Subversion will execute it. A kind of manual, but you can write a script to do this first, and then execute the actual svn commit .

+1
source share

The only thing I can think of is to use the SVN SVN binaries and call them from the page. That way you can split everything else and get the revision number. To be honest, this is a somewhat ugly decision.

0
source share

All Articles