Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 490725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:56:19+00:00 2026-05-13T01:56:19+00:00

I have a rails site. I’d like, on mongrel restart, to write the current

  • 0

I have a rails site. I’d like, on mongrel restart, to write the current svn version into public/version.txt, so that i can then put this into a comment in the page header.

The problem is getting the current local version of svn – i’m a little confused.

If, for example, i do svn update on a file which hasn’t been updated in a while i get “At revision 4571.”. However, if i do svn info, i get

Path: .
URL: http://my.url/trunk
Repository Root: http://my.url/lesson_planner
Repository UUID: #########
Revision: 4570
Node Kind: directory
Schedule: normal
Last Changed Author: max
Last Changed Rev: 4570
Last Changed Date: 2009-11-30 17:14:52 +0000 (Mon, 30 Nov 2009)

Note this says revision 4570, 1 lower than the previous command.

Can anyone set me straight and show me how to simply get the current version number?

thanks, max

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:56:19+00:00Added an answer on May 13, 2026 at 1:56 am

    Subversion comes with a command for doing exactly this: SVNVERSION.EXE.

    usage: svnversion [OPTIONS] [WC_PATH [TRAIL_URL]]

    Produce a compact ‘version number’ for the working copy path
    WC_PATH. TRAIL_URL is the trailing portion of the URL used to
    determine if WC_PATH itself is switched (detection of switches
    within WC_PATH does not rely on TRAIL_URL). The version number
    is written to standard output. For example:

    $ svnversion . /repos/svn/trunk 
    4168
    

    The version number will be a single number if the working
    copy is single revision, unmodified, not switched and with
    an URL that matches the TRAIL_URL argument. If the working
    copy is unusual the version number will be more complex:

    4123:4168 mixed revision working copy
    4168M modified working copy
    4123S switched working copy
    4123:4168MS mixed revision, modified, switched working copy

    If invoked on a directory that is not a working copy, an
    exported directory say, the program will output ‘exported’.

    If invoked without arguments WC_PATH will be the current directory.

    Valid options:
    -n [–no-newline] : do not output the trailing newline
    -c [–committed] : last changed rather than current revisions
    -h [–help] : display this help
    –version : show version information

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a staging Rails site up that's running on MySQL 5.0.32-Debian. On this
I have a rails model that looks something like this: class Recipe < ActiveRecord::Base
I have a Rails app that I have successfully tested with Mongrel and Webkit.
I have a Ruby on Rails site that uses thinking sphinx for searching a
I have a Rails site that uses Devise for authentication. I have one page
I have a Rails 3 site I'm working on that has users who operate
I have a simple animation on my rails site that pop's a div (with
I have a web server that hosts Ruby version 1.8.5. Which version of Rails
I have a Rails site, where the content is written in markdown. I wish
I have a site in rails and want to have site-wide settings. One part

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.