Converting Subversion to Mercurial/Git

A few years ago, I set up a privately hosted Subversion repository to hold the source code for all of my various non-work related projects. These days, it is showing it's age, as the world and my professional life has moved on to Distributed Source Control (DVCS). I decided it was time to convert to something more modern, maintainable, and upgradable in the future.

In this post, I'll show you how I converted my repositories over to Mercurial to archive them in Kiln, complete with history. There are a number of ways to accomplish this goal, and I thought this method was fairly simple and straightforward.


First, install TortoiseHg if you haven't already done so. You actually won't need Subversion installed to do the conversion.

Next, right click anywhere in an Explorer window, select TortoiseHg->Global Settings:


Go to the "Extensions" section, and check the "convert" checkbox, which will enable the conversion extension functionality:


One Repository vs Many

In Subversion, there were two common repository structure camps. One that used a single repository for multiple projects, and those that used a separate repository for each project. Due to the complexity of setting up projects on the Subversion server, I always stuck with the "one giant repo" model.

In Git, repositories will be distributed and are ideally as lightweight as possible. The typical pattern is to create a new repository for each project. This obviously means that we have to do some work to separate out a single Subversion repository into multiple Git repos.


Creating a Filemap (optional)

If you have separate repositories in Subversion, you can skip this step.

Create a "filemap", which is just a text file with the name of your choosing that will look like this:

include "Utilities/ProjRefToDll"
rename "Utilities/ProjRefToDll" .

The first line is telling the converter to only include the path specified. The second line is telling the converter to move the project to be in the root (note the period) of the new repository. If we leave this out, we'll only have the project we're looking for, but our source code will be nested under folders from our old structure.

You'll need to update this file for each project you convert.


Run the following command line with the correct paths (omit the filemap parameter if converting the whole repo):

"<path-to-hg>\hg.exe" convert -s svn "<path-to-svn-repo>" --filemap "<path-to-optional-filemap>"

Here is the command I ran:


It will then iterate through every revision in the source repository, even if it's not relevant to the filter you're applying. It will create a new folder next to the folder you're converting, but with a "-hg" suffix, like this:


Open it up, and it will be a full-fledged Mercurial repository. Do an "update" to confirm that everything looks like you expect:


At this point, you have successfully converted a project from your Subversion repository into a Mercurial repository, revisions and all.

Personally, I'm using Kiln as my online source archive. Even if you aren't interested in Kiln, and instead want to use something like GitHub, no problem, push it up to Kiln, and then pull it via Git for an automatic conversion at any time! I'm using Kiln for the time being, considering that it's free for up to 2 users. It works great for my personal projects that I don't want public on GitHub. My plan is to eventually scrub those projects, and put the latest revision of each out on GitHub to make available to the community.

I'm not sure if I'm switching the full repositories to Git yet, so I like the flexibility that Kiln offers. If you are interested in converting to Git directly, there is probably an easier way.

Like this post? Please share it!

See a mistake? Edit this post!

The Pomodoro Technique & Scrum/Agile

I recommend checking out the Pomodoro Technique. It's a super simple productivity technique that is designed to improve your focus and your own productivity by eliminating distractions, and maintain concentration by taking breaks at optimal times.

The best part is that there is no book to buy, and you can get started in minutes. The Pomodoro website can get you up and running quickly. Basically, you're focusing on a single task for 25 minutes, and then you take a 5 minute break before starting the next Pomodoro. After 4 Pomodoros, take a longer break.

Lifehacker users voted it the #1 productivity method, and I find that it's compatible with the Getting Things Done methodology (a book I personally recommend). Will it cure world hunger? No. In fact, you can't even eat the timer even though it looks like a tomato.

It works a lot like scrum. You create your list of tasks, and then estimate them based on the number of Pomodoros they will take to complete. Each day is like a sprint, and each Pomodoro is like a story. As you get better at the technique, you perform daily retrospectives to improve the process and the estimation. If you don't like their pencil and paper approach, you can use Trello.

I'm definitely not an expert, but I've already realized some of the benefits. It's amazing how many little distractions occur in a 25 minute period, killing productivity. Unlike a computer, we humans are absolutely terrible at switching tasks.

With an entire team, the challenge would be coordinating everyone to minimize potential interruptions. I did find some teams using it with limited success. For example, here is a detailed analysis of Pomodoro combined with Scrum:

Some interesting quotes from that article:

"I think expanding the Pomodoro Technique® to a whole team can prove very difficult. Probably it's not even desirable."

"How you work most efficient is very individual, but to be productive I think you have to feel comfortable about, and like, the way you work."

Give it a try. Couldn't hurt.

Like this post? Please share it!

See a mistake? Edit this post!

My Ivy Bridge i7 PC Build

I recently had an opportunity to sell my original i7 920 PC, and build a 3rd generation Ivy Bridge. My goal was to minimize power usage so that I could run it as a 24/7 media server, and maximize its encoding horsepower. After hooking this build up to a Kill-A-Watt, it measured at just over 30 watts at idle, and less than 100 watts maxed out.

Component List

Total Price: $897.36 + shipping

Processor: Intel Core i7-3770K 3.5GHz


This was the first component I picked out, as a suspected all of the other components would be dependent on the processor. We have built some AMD machines at work, but they are severely lagging behind their Intel-based counterparts for performance and power usage. Intel is a little pricier, but definitely worth it. I went on the high-end as far as speed to minimize video encoding time, and hopefully prolong my next upgrade as long as possible.

Since I don't have any intentions of using this system for high-end gaming, my goal is to actually use the Intel 4000 graphics that are integrated into the chip. Integrated graphics are still significantly behind their discrete counterparts, but this saves me over 100 watts of power usage.

Motherboard: ASRock Z77 Extreme 4

Z77 Extreme4(m)

I always find the motherboard the hardest component to spec for a new build. In the past I've chosen Gigabyte boards for their low price and innovative features such as long-life solid state capacitors. However, I ran into some buggy firmware with my last build, and hoped to avoid them this round. Solid state capacitors are now the norm, so features and stability were my primary goals. We've used a few ASRock boards for builds at work, and they have worked flawlessly. They are also the current leader for fast booting when using UEFI. At $105 for this board, it seemed like a great price/value ratio. It has dual-monitor outputs so that I can use the integrated graphics while still keeping 2 monitors.

Below is a thermal image from the board. Notice that the ASRock chipset is at 143F. I can't explain why it runs so hot. It's not hot enough to be a huge concern, but I would prefer to keep every component cool for long life.


Memory: 32GB G.SKILL


Memory speed used to have a significant impact on the real-world performance of your system. These days, buy memory that is well reviewed and falls within the memory speed requirements of your motherboard. At the time of my purchase, I was able to get the Ares memory for only $55 for 2x8GB strips. At this price, it was worth maxing out the board at 32GB (I'm still in awe) just to avoid a future upgrade. One interesting feature of the motherboard is the ability to use part of the RAM as a RAMDISK, which is essentially a virtual hard drive that would outperform even the best SSD.

PSU: SeaSonic M12II 620 Bronze 620W


Bad power supplies create bad power, which kills components. A good power supply will provide clean power, which will make your system more stable, and will help ensure a long lifespan for all of the other components.

Why did I choose a 620W power supply? My experience has been that people often oversize their power supplies. If you use a 1000W power supply on a 50W load, it's going to be terribly inefficient. Power supply efficiencies, which measure the amount of power lost in the conversion from AC to DC, are only accurate when the power supply is under heavy load. As you get out of the sweet spot, efficiency drops. When sizing a power supply, the #1 power consumer is your video card. An inefficient video card will pull more power than the rest of your system. Add multiple cards and the power requirements go through the roof. In my case, I'm using integrated graphics and shooting for low power usage. My goal was to stay under 100W at load on the DC side of the power supply. With an 85% efficiency, that would be about 118 watts on the AC side. Even at 620W, this power supply is WAY oversized. However, I have a quality power supply that gives me plenty of headroom for any upgrades down the road. Besides, there are not many well-built power supplies at lower wattages these days.

Hard Drive: Crucial m4 128GB SSD


SSD's are undoubtedly the biggest technological breakthrough in computing as it relates to the perceived speed of the computer. People usually quote 7 second boot times, but the value is truly in the fact that applications open instantly.

I've had my fair share of bad luck with SSD's. Since they're a newer technology than their spinning disk counterparts, they have firmware that can be buggy in certain versions. I was a victim of the OCZ firmware bug, as well as the 7 month bug in the Crucial drives. That being said, I trust this drive thanks to its fairly consistent track record, and favorable performance.

Why only 128GB? I have a 3TB storage array that I use for my bulk data. Unless you install a number of large games on your SSD, or store other bulk data, 128GB is fine for just about everyone. If you feel more comfortable with the 256GB version, the price gap has closed significantly.

Case: Antec 300


I hate choosing a case. Without seeing them in person, it's difficult to gauge their build quality and features. I've used this case in the past, and it's worked well enough. It's usually inexpensive, and easy to work with. It has excellent ventilation, a cleanable air filter, and a place to mount your SSD drive.

CPU Fan: ZALMAN 92mm


I ran some temperature tests on the i7 Ivy Bridge with a stock cooler, and found that it can run pretty hot under load. An upgraded fan was probably not absolutely necessary, but it's a $50 investment that guarantees that your CPU will run 20-30c cooler. This one is a simple design that's easy to install, and the copper fins dissipate heat very easily.

Here is a photo using a Flir thermal camera. Notice that there is almost no measurable heat coming from the heat sink on the right side of the image.

Blu-ray / DVD: LG Blu-ray Drive


This was probably overkill, but it was the only Blu-Ray drive that I could find that got exceptional reviews, and is 16x.

Like this post? Please share it!

See a mistake? Edit this post!

Jason Young I'm Jason Young, software engineer. This blog contains my opinions, of which my employer - Microsoft - may not share.

@ytechieGitHubLinkedInStack OverflowPersonal VLOG