151

I know how to browse my project's Subversion repository through its web front-end, but it seems that I can only browse the latest revision of the trunk. Is there a way to browse an older revision of the trunk through the web UI?

I know how to do this from the command-line, but I need to know how to do this using URLs, because I'm embedding these URLs into a document. I also know I could create an svn-style tag of the trunk, but I would prefer not to do that.

1

6 Answers 6

190

Append something like this to your repository URL:

!svn/bc/<revision_number>/

E.g.

http://www.example.com/svnrepository/!svn/bc/3/

Alternative

From Bert Huijben's comment:

If your repository is hosted using Subversion 1.6.0 or later, you can use example.com/svnrepository/?p=3 for the same result... This method /is/ documented. (?r= revision of the file, ?p= operational revision of the URL). See the subversion 1.6 release notes

8
  • 9
    I am absolutely stunned this works... (I just checked and it does). I've been told many times it's not possible. Note that the string mentioned must be right after the repo root in the URL, then you can put subdirs of the repo after it.
    – rmeador
    Mar 16, 2009 at 17:27
  • 58
    If your repository is hosted using Subversion 1.6.0 or lateryou can use example.com/svnrepository/?p=3 for the same result... This method /is/ documented. (?r= revision of the file, ?p= operational revision of the url). See the subversion 1.6 release notes Mar 27, 2009 at 12:09
  • 2
    Just as an amendment to BertHuijbens post, to view a past revision of a specific folder, you would do example.com/svnrepository/path/to/specific/folder/?p=3. For some reason or other, I thought the ?p=3 would come first, and figured I'd post about her here
    – shmeeps
    Nov 14, 2011 at 19:41
  • 1
    As this is as obscure as possible, is worth to note that accessing a file is achieved adding its path after that chunk. E.g. example.com/svnrepository/!svn/bc/3/tags/1.0 took me a while to realized!
    – albfan
    Jun 4, 2014 at 12:38
  • 3
    The comment by @rmeador really needs to be incorporated into this answer, which is otherwise misleading: you do NOT stick !svn/etc... onto the end of your URL. (1) find your Repository Root by svn info . (2) after that append /!svn/bc/<revision_number>/ (3) then append the path to your directory or file, if any.
    – Bob Stein
    Apr 18, 2019 at 22:59
82

Append this to your repository's URL:

?p=24

Examples:

http://www.example.com/svnrepository/?p=65
http://www.example.com/svnrepository/subdir/file.html?p=42

Documentation: http://subversion.apache.org/docs/release-notes/1.6.html#historical-uris

1
  • 3
    Excellent work. Much simpler than the accepted answer.
    – pmckeown
    Jan 8, 2015 at 1:19
1

It depends on the svn webclient you're using. In the case of trac (and maybe some others), just add the the parameter rev= to the querystring.

i.e. http://trac.example.com/log/trunk/client/filename?rev=123

1
  • 3
    Tried this, didn't work, it just got the most current revision of the file.
    – jcollum
    May 19, 2011 at 16:18
0

If you use VisualSVN Server 3.2 or newer then you can use its HTML5-based web-based history browser for this task. For example, here is a repository tree as it existed in revision 1001 of serf network library repository.

See the description of the web interface.

0

From the web, you can go to the repository SVN page and add / after it:

https://<host>/subversion/source/<revision>

for example:

https://app.assembla.com/spaces/myproject/subversion/source/1200
-3

The built-in web interface does not allow retrieving of old revisions (or any other info than what you've already seen). You can install third-party web-based repository browsing software to get around this limitation. I haven't used any myself, so I'm not going to offer recommendations, but I'm sure others will (a quick google search will help you find some too).

3
  • as SebaGR notes, it is possible to access older revisions if you manipulate the URL directly. There is no UI for doing this however. It's quite a surprise to me that this is possible at all, since I've been repeatedly told it isn't...
    – rmeador
    Mar 16, 2009 at 17:28
  • 6
    In Subversion 1.6.0 the ?p= and ?r= arguments where added as public (and documented) feature. Mar 27, 2009 at 12:10
  • 3
    1.5 did/does not allow revision browsing through the built-in WebDAV interface. From svnbook.red-bean.com/en/1.5/svn-book.pdf: >Can I View Older Revisions? >With an ordinary web browser? In one word: nope. At least, not with mod_dav_svn as your only tool.
    – Zach Young
    Mar 3, 2014 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.