It’s easy, actually.
Maybe, like us, you have a small team and code base kindly hosted by someone like ProjectLocker. But maybe, like us, you were converted to something a bit more integrated like FogBugz and Kiln. We didn’t think we would be, but one of us attended the FogCreek team’s demo last January and this is where it all went wrong… If you have seen Joel Spolsky talk live, you probably know what we mean. The man can be rather persuasive.
In this post Angela provides a step-by-step guide to the process.
I found the transition steps from ProjectLocker to Kiln quite smooth; there was help in the FogBugz manuals too. Couldn’t find the whole process described anywhere, though, so here it is:
1. Get a local clone of your ProjectLocker repository
-
Install SVN, if you haven’t already
http://subversion.apache.org/packages.html
- Create an empty SVN repository on your machine,
let us call it “Repo”:svnadmin create /path_to_repository/Repo
- Enable changes on the repository’s revision history
We want to get a clone of the remote repository locally, including all of its revision history. Subversion doesn’t normally let you, and for your own good, modify the revision properties of a repository, so if you try and synchronise with ProjectLocker at this stage, you are likely to get the following error message:svnsync: Repository has not been enabled to accept revision propchanges; ask the administrator to create a pre-revprop-change hook
Subversion uses a hook (script), called pre-revprop-change, which can take care to back up old revision properties before they are modified. You can find a template for this and other hooks in the /hooks/ folder of your local repository – there should be a bunch of .tmpl files there.
For the hook to be found and used by Subversion’s svncync tool we’ll need to create a pre-revprop-change file in the /hooks/ folder of your repository; pre-revprop-change.bat, if you are using Windows.For the needs of mirroring the remote repository into our new local one an empty executable pre-revprop-change file should do. This means an empty pre-revprop-change.bat on Windows and a file, containing “#!/bin/bash” on Mac OS/Linux.
You can have a look at pre-revprop-change.tmpl for an example of the checks it could do before a change is allowed (who makes the change, what the change is, what property is being modified, in which repository, etc.). Here is an example pre-revprop-change.bat for Windows.
Note: Make sure you make the file executable (i.e. have rights to execute it on Mac OS/Linux), of you may get “exit code 255” error:
svnsync: Revprop change blocked by pre-revprop-change hook (exit code 255) with no output.
- Initialise the local repository to mirror the ProjectLocker one
svnsync init file:///path_to_repository/Repo https://free2.projectlocker.com/path_to_ProjectLocker_repository/svn
- Synchronise the two repositories
svnsync sync file:///path_to_repository/Repo
The remote repository should be copied over revision by revision:
Transmitting file data ....... Committed revision 1. Copied properties for revision 1. ...
You should now have the local clone of your ProjectLocker repository, containing the history with all the changes you’ve made to it.
2. Download and install Mercurial
Mercurial is the source control management system, on top of which Kiln works. It is free and is designed to handle large distributed projects. You can get it here:
http://mercurial.selenic.com/downloads/
If you like talking to something different than a command line, there are a few UI options that will make you happy. Ones we tried are:
TortoiseHg – a shell extension, which integrates with Windows Explorer on Windows (it has versions for Linux too).
MacHg – a GUI client for managing Mercurial repositories on Mac OS.
3. Convert and upload your repository to Kiln
- Create a Kiln account, if you haven’t already.
- Create a new repository on Kiln
Log in to Kiln, go to Brose Repositories > Browse All and click on New Repository:
- Import your local repository to Kiln
After you create and name your Kiln repository, follow the instructions under Put code in this repository > I have existing code…
Links I found useful:
- Implementing Repository Hooks, chapter of “Version Control with Subversion”, which explains what hooks are
- Subversion FAQ
- Windows and SVN hooks – an example pre-revprop-change.bat for Windows, kindly provided by AyriA
- Move SVN repository from ProjectLocker – StackOverfow post
- Tips on using svnsync in Paul Querna’s Journal