Saturday 15 January 2011

ruby on rails - Write current svn version into text file -


I have a rail site, I would like to write the current SVN version in public / version.txt, again Start, so that I will put it in a comment in the page header.

The problem is currently happening. Local version of SVN - I'm a bit confused.

If, for example, I update svn on a file that is not updated in some time Has been "get me the revision at 4571". However, if I do svn info, then I get the path

.
URL:
repository route:
repository UUID: #########R संशोधन: 4570
Like node: Directory
schedule : General
Last converted author: Max
Last modified Rev: 4570
Last change date: 2009-11 -30 17:14:52 +0000 (Mon, 30 Nov 2009)

Note that, the revision 4570 is less than the previous command.

Can anyone set me to show me how to get just the current version number?

Thanks, Max

Subversion comes with a command to do this :.

Usage: svnversion [options] [WC_PATH [TRAIL_URL]]

Creating compact 'version number' to work Copy path WC_PATH TRAIL_URL to determine the last part of the URL For whether WC_PATH is the only switch (does not trust TRAIL_URL to detect the switch within WC_PATH). The version number is written on standard output. For example:

  $ svnversion / Repos / svn / trunk 4168  

Working copy is not a revenge, unsmoded, switched and URL with which TRAIL_URL Logic matches if the working copy is abnormal then the version number will be more complex:

4123: 4168 Combined modification work copy
4168m Modified work copy
4123S functional copy switch
4123 : 4168MS Mixed Amendment, Modified, Switching Working Copy

If such an independent Is applied to complaints and s is not a copy of the work, says an exported directory, program output "will export.

WC_PATH will be the current directory without any argument if applicable. Valid options: -n [- No new line]: Do not output the previous new line-up [- committee]: Last change instead of current modifications - h [--help]: This help displayed Do - Distortion: Show version information


No comments:

Post a Comment