svn

HOWTO: Build a PHP Development Environment on Windows

This tutorial will walk you though setting up a complete development environment on Windows. I am using Windows 7 Home Premium, 64-bit. This setup also works well on Windows XP, and I have heard this also works on Vista, although I have never run Vista myself.

In the end we will have the following installed:

  1. Apache Web Server
  2. PHP for server-side processing
  3. mysql database server
  4. phpmyadmin for managing mysql databases via a web browser
  5. SVN Server for source code version control

HOWTO: Backup and Restore of SVN Repository

Your SVN repository is a complex database subject to corruption and data loss just like anything else. Given that it is not a simple flat file, the good folks who bring us SVN provide some tools to dump to flat files and restore.

For good measure, you may wish to verify your repository:

svnadmin verify /path/to/repository

Dump repository to a single flat file:

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

Optional, for demonstration of a restore:

Create a new empty repository:

svnadmin create /path/to/RESTORE

TortoiseSVN cache resource usage high: TSVNcache.exe

A couple weeks ago I was wondering why the TortoiseSVN icon overlays in Windows Explorer icons were not changing immediately. When I started working on Symfony projects with 3700+ files and Magento projects (10,000+ files) I noticed my hard drive was always active and the CPU partially taxed. The culprit was TSVNCache.exe.

As it turns out, TortoiseSVN caches the state of the files with respect to the repository, explaining why they do not always immediately change. The more files to scan, the more cache scanning is required.

Tortoise SVN

The most intuitive interface to SVN on Windows is Tortoise SVN.

It is a fantastic integration of SVN functions into the Windows Explorer. Right-click on folders and files to perform any SVN function.

The difference window is color-coded to show additions, deletions, and modifications, character-by-character.

The merge tool is also quite easy to use.

Subversion

Subversion is a client-server open source version control system.

Subversion employs an optimistic approach to file locking to encourage concurrent development. Unlike Microsoft Visual Source Safe, one need not lock a file before editing by explicitly checking it out. In fact the term "check out" has very different meanings in VSS and SVN.

Subversion becomes Apache Subversion

Subversion is now officially an Apache project, which is great news for the long-term support of this version control system.

As seen today on http://subversion.apache.org:

The Subversion project is pleased to announce that we have graduated from the Incubator at the Apache Software Foundation and are now officially Apache Subversion. Although this is largely a procedural step, it's an important one for our goal of making the ASF the permanent home of the Subversion community.

Fix corrupted SVN repository that fails svnadmin verify

Ok, this is not going to fix every corruption that you might experience, but we have a small private SVN repository running on a Windows box that recently hung during a nightly backup using hot-backup.py a Python script we found out on the net.

I immediately ran svnadmin verify C:\svnrepos and found that revision #29 would not verify. I thought this strange, since we're up to revision 2093, and we've had clean verifications up until now.

Then, I immediately ran svnadmin dump C:\svnrepos > D:\svndump-2093.dmp to backup the repository, even if it was in a corrupted state.