With Mercurial sunsetting support, it was time to move our repos. But how do you do this en masse?

When we received the first communication about Bitbucket sunsetting Mercurial support, there was quite a lot of excitement around the office. All of our source code was stored as Mercurial repositories on Bitbucket and — being a product company — a lot of the company’s value is in the source code.

A closer look at the problem presented us with the following challenge:

  • 350 Repos across 5 teams to convert.
  • Retaining the commit history for all projects.
  • All branches need to be converted.

A solution was needed, but many searches and discussions later, nothing suitable was found. So, we decided to wait. There was still plenty of time and we trusted that a solution would surely present itself sooner or later.

However, when the reminder from Bitbucket arrived, no solution had as yet presented itself and time was starting to run out. A few searches later we found the  fast-export  converter by frej, a Python project on Github that we could use to convert our repos one-by-one. While each individual migration seems simple enough, our challenge was the fact that we had to do this in bulk.

#git #automate #mercurial #repo

Automating Bulk Transfer of Mercurial Repos To Git
1.20 GEEK