Archive for the ‘svn’ tag
Adding SVN keyword expansion in Tortoise SVN
When using Tortoise SVN client to access my Subversion repositories from Windows, I tend to forget to set up keyword expansion (unlike in the Linux command-line, where one can always invoke svn propset svn:keywords "Id Date Author" somefile).
In Tortoise, this can be done by enabling auto-props in the configuration. In Windows Explorer, right-click to get to the Tortoise context menu:

(Yes, I’m a bit O.C. so even my resume is under version control. :P)
Edit the Subversion configuration file, specifically the following properties:
[miscellany] ... enable-auto-props = yes ... [auto-props] *.txt = svn:keywords=Date Id Rev Author URL;svn:eol-style=native *.html = svn:keywords=Date Id Rev Author URL
This tells Tortoise to expand the keywords specified for the given files. Note that this works only on new files added to the repo after the configuration has been modified.
Quickies
- Registered diecastminis.com. Now, www.diecastminis.com point to my hobby blog.
- My iandexter.net Google-hosted email is having DNS problems. Hay…
- Wracking my brain all day, trying to figure out how to migrate Serena Version Manager files to Subversion. So far, PVCS-to-RCS has been successful, but it only gets the latest version — no version history!
Update: The DNS resolution issue points to my availment of a service from my domain registrar — turns out they had to point my domain to their name servers. Thus, the MX record for iandexter.net vanished. Fast propagation, though, as I got nearly instantaneous update.
Up-update: Interestingly, during the period when the MX record did not resolve, I still received spam mails. Spam is that resilient? I shudder at the thought.
Using SVN for web development
Here at my new workplace, there are more than 20 web apps that are being developed in-house. They go through the following workflow: devs use development and staging servers for tests, and after QA, the new builds are pushed to the production servers.
They’ve employed a custom version control system for coding, but it’s not panning out. They need an automated way of pushing updates to the dev and staging servers for a quicker turn-around time.
Enter Subversion. I’ve used Subversion both in production and in personal projects. (I haven’t used CVS so I can’t compare the two.) The way I see it, the web apps can be pushed this way:
- Install SVN with WebDAV support.
- Create the repositories’ directory trees:
mkdir /path/to/repository/projectname
- Note that the repositories have to be owned and writeable by the
httpduser:chown -R httpd:httpd /path/to/repository/projectname; \\ chmod g+s /path/to/repository/projectname
- Create the SVN repositories:
svnadmin create /path/to/repository/projectname
- Import the current working directories for the projects:
svn import /path/to/working/project/dir \\ file:///path/to/repository/projectname
- Remove the working directories (backup first):
rm -rf /path/to/working/project/dir
- Check out directory trees from the repo:
svn co file:///path/to/repository/projectname
- Edit and commit changes:
svn ci
- Or, pull changes:
svn update /path/to/working/project/dir
Easy so far. I’ve also added an HTTP URL for the SVN repos using Apache’s WebDAV extensions. In httpd.conf, just add the following:
LoadModule dav_svn_module modules/mod_dav_svn.so <Location /repos> DAV svn SVNParentPath /path/to/repo/root </Location>
Restart the service. Now the repo can be accessed via http://reposerver/repos/projectname.
But I hit a snag: I can’t get the post-commit hook to run on commits! I’m leaning on problems with the permissions, but it’s eluding me right now. *sigh*
