More Tips on Subversion

In my last post I had shared a few tips on subversion addressing issues that I felt were challenging. To add to that list I would like to share a few more. One of the most common issues that I had encountered (while working with subversion and TortoiseSVN) is that the working copies stop displaying the shell overlays (icons), and sometimes a few icons may appear and the other icons might not. The Windows explorer sometimes ignores refresh notifications. The reason behind such behavior is too many application notifications that can jam TortoiseSVN. So to avoid this, the explorer sometimes ignores the notifications and that’s why the icons don’t get displayed. The solution is available in the following link:

http://tortoisesvn.tigris.org/faq.html#ovlnotall

Read up on: Why don’t the icon overlays appear?
The overlay icons appear, but not all of them!

My next tip is on how to delete a file or folder and its entire history from Subversion. Well, unlike with Git History there is no straight forward way to achieve this, as Subversion is not meant for that. You can however do this with the help of your Subversion Admin. This is how you can proceed:

svnadmin dump /path/to/repository >repo.dmp

svndumpfilter exclude /file_or_directory_to_exclude <repo.dmp >cleaned_repo.dmp

rename /path/to/repository to something else

svnadmin create /path/to/repository

svnadmin load /path/to/repository < cleaned_repo.dmp

Here is another useful tip:

Say you want to know the last changed revision or the last modified date of some particular file that you checked out from within the file itself; you can use subversion keyword substitution:
http://svnbook.red-bean.com/en/1.7/svn.advanced.props.special.keywords.html

When to use SVN URL redirect –

Query: We have migrated our SVN repositories from one host “abc” to another host “xyz” , but we want all existing URLs (having http://abc.com/svn/project-A ) redirected to new host as http://xyz.com/svn/project-A without breaking developer’s bookmarks and doing svn relocate in all the working copies.

Solution: You just need to use Apache’s Rewrite-related directives in the abc.com server’s httpd.conf.

See http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html for the details of mod_rewrite’s configuration.

As a starting point, you might use something like this:

# permanently redirects all requests aimed at Subversion repositories
# to the matching relative location on xyz.com.
RedirectMatch ^/svn/(.*)$ http://xyz.com/svn/$1

Subversion 1.7+ clients will automatically redirect any working copies checked out from abc.com the next time the user performs and ‘svn update’. Older clients will print an error that instructs the user to do this relocation themselves.

Tagged with: , ,
Posted in Subversion
2 comments on “More Tips on Subversion
  1. Deepak Patalay says:

    Hi Vishwajyoti Bhattacharjee

    Good day to you and hope you receive this mail in high spirits!! I represent the Cyient Ltd., Hyderabad, India.

    I’ve installed Tortoise Subversion v1.8.0 for a high budget project with a team size of around 300 developers here. As a part of my study upon this software, we’ve installed Visual SVN Server as well as Tortoise SVN Client. We have created and stored our repositories on the SVN Client. We have configured these repositories into the SVN Server. We have also created two users and one group in which one of the users is linked. With these users’ names, when we would like to “Browse” and then try to log in, we get an ‘Internal Server Error’.

    We have checked with our user names and passwords (for any typo errors) but find no such mistakes from our end.

    May I kindly request you to guide me over any possible errors we are committing or that we have overlooked while configuring or browsing the repositories?

    Your suggestions will be highly regarded.

    Regards and Thanks,
    Deepak.

Leave a Reply

Your email address will not be published. Required fields are marked *

*