What to do with your Mercurial repos when Bitbucket sunsets support

531 comments

speleolinux
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 30, 2019

It's a shame. I signed up with BitBucket because it supported hg. I used hg because I preferred it over git and more importantly my users who are not coders can be taught hg much easier than git. They use the EasyMercurial GUI, and there is nothing like that for git.  I won't be moving away from hg hence when the crunch comes I'll be leaving BitBucket and my account at Atlassian will be closed. I have appreciated the free hosting for open source projects over the years so will be sorry to leave.

Mike

Like # people like this
clach04
Contributor
August 31, 2019

Jotting down my notes (some of which matches other posts).

GitHub's code/history import https://github.com/new/import worked well for me to import and convert a Mercurial code repo. It does not handle:

* project description - needs to manually copy/pasted 

* project logo/avatar/image  - needs to manually  set (note you may not be able to get the original image that was used to upload, only a scaled-down copy unless you have the original stored somewhere)

* Issues / history / attachments

* PRs / history

* Downloads

* wiki

I was able to import/convert the wiki, similar to @mikedoerfler experience, Windows with bash and https://github.com/frej/fast-export worked well but PYTHON=python is needed to avoid `python2 not found` messages. His post is at https://community.atlassian.com/t5/Bitbucket-articles/What-to-do-with-your-Mercurial-repos-when-Bitbucket-sunsets/bc-p/1163252#M325

For the wiki I had to create an initial page and then force push the new git repo. The wiki content did need to be edited.

* Links seemed to work

* images links needed conversion from mediawiki to Markdown

* headers need converting to markdown

 

I only tested as a small project.

Like kuchura likes this
clach04
Contributor
August 31, 2019

Jotting down my notes (some of which matches other posts).

GitHub's code/history import https://github.com/new/import worked well for me to import and convert a Mercurial code repo. It does not handle:

* project description - needs to manually copy/pasted 

* project logo/avatar/image  - needs to manually  set (note you may not be able to get the original image that was used to upload, only a scaled-down copy unless you have the original stored somewhere)

* Issues / history / attachments

* PRs / history

* Downloads

* wiki

I was able to import/convert the wiki, similar to @mikedoerfler experience, Windows with bash and https://github.com/frej/fast-export worked well but PYTHON=python is needed to avoid `python2 not found` messages. His post is at https://community.atlassian.com/t5/Bitbucket-articles/What-to-do-with-your-Mercurial-repos-when-Bitbucket-sunsets/bc-p/1163252#M325

For the wiki I had to create an initial page and then force push the new git repo. The wiki content did need to be edited.

* Links seemed to work

* images links needed conversion from mediawiki to Markdown

* headers need converting to markdown

 

I only tested as a small project.

Like hugovk likes this
tpip
Contributor
September 1, 2019

I found that the easiest way to convert a repo from Mercurial to Git was using GitHub's automatic online converter. It also maintains the branches; the other solutions I tried did not do that. Step-by-step directions on Stackoverflow: Convert to Git using Github's online converter

Like # people like this
Zunino
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 2, 2019

While I understand companies sometimes need to focus their resources, I must say I feel sorry for the announcement of Mercurial support being dropped. As many others have mentioned, that was the main reason for choosing and sticking with Bitbucket for all these years. I'm quite thankful for the service provided and, honestly, that feeling would be the only reason to stick around if Mercurial is indeed dropped. Regardless, I predict a migration of significant proportions to GitHub once people start converting their repositories.

Like # people like this
mahlon
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 2, 2019

Ugh.

I originally started using BitBucket because I vastly preferred Mercurial to Git, and needed some project pages and ticketing -- maintaining a local Trac instance was becoming an increased burden.  BitBucket was best-of-breed before Hg was so clearly abandoned by Atlassian a few years ago.  I've genuinely appreciated the continued free hosting for personal projects, and while I haven't personally been a source of your revenue, my $dayjob absolutely uses various Atlassian products.  While I'm disappointed, I can't say I'm terribly surprised.

What I am surprised by is the lack of pathway you're providing.  This specific decision undermines my faith in Atlassian enough that I will be recommending alternatives across the board. While 3% of your BitBucket customer base doesn't look like much on paper, erosion of confidence reverberates - I'm honestly appalled at both the messaging "we're deleting your data and metadata with no conversion help even across our own platform" and the response "we're giving you months to figure it out!" If I were in your PR crew, I'd be pretty embarrassed right now, and scrambling to provide some form of a continuity path -- your Mercurial users are most likely your oldest and most loyal considering your start.

Echoing those above me:  If there was remaining trust, I'd continue using BitBucket with the hg-git extension.  Since I'm losing metadata anyway, I found moving to GitHub was as easy as creating a new (empty) project, then just pushing to it with the hg-git extension. Also trying out SourceHut for native Hg (which incidentally, includes Evolve.)

Like # people like this
philipstarkey
Contributor
September 2, 2019

I believe I have figured out how to extract pull request history (comments, etc) using the bitbucket API (and this should also apply to comments on commits).

I plan on writing a tool to automate the extraction of this data. I'll also potentially look into ways this could be published on GitHub (probably as static pages on a GitHub pages repository as actually recreating pull requests is problematic, but we'll see), potentially with integration with the existing issue migration script that was linked to earlier in this thread (so that URLs etc in issues are updated to point to the new location).

I'm absolutely livid that Atlassian are not doing something like this themselves (and that someone like me has to spend their own time doing it). I worry for their business model if they can't spare one developer for a couple of weeks to write something that would help a few percent of their users.

I'll post here once I have something working that other people can use.

Like # people like this
Jonathan Leaders
Contributor
September 4, 2019

Honestly, if you just offered a paid path and kept Hg you'd be making a better decision. I would pay just to avoid the hassle of migration. Take my money

Like Peter Koppstein likes this
davidm_uk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 5, 2019

I agree, Jonathan. Despite the degree to which I've now lost trust in Atlassian, I too would pay to remain at Bitbucket with Mercurial to avoid the hassle of migrating.

I migrated 16 personal repositories last night to GitHub, and I've performed a test migration of our largest work repository. The process isn't too bad for us as GitHub import works well for the basic repository and we haven't used any of Bitbucket's add-on features. However, getting everyone to re-clone from GitHub (and in some cases learn Git) will be a real pain. We'll need to schedule a weekend when we migrate the work stuff, and spend time learning Git, helping users etc. in the following week.

I'm sure many people here are in a far more difficult position than we are, so the total overall work required by the Bitbucket-using community will be significant. What a waste...

Like # people like this
-tukanos-
Contributor
September 6, 2019

Codeplex shutdown - https://devblogs.microsoft.com/bharry/shutting-down-codeplex/ - this is how you you depreciate your service - create a way for your customers to migrate, have an archive.

Like Svante Seleborg likes this
Ruslan Berezyuk
Contributor
September 6, 2019

Two years ago you were telling us a different story ...

image.png

Like # people like this
centroaktis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 7, 2019

I think this decision is a suicide for Bitbucket.

For sure I won't migrate to Git, given that Mercurial is far superior in many aspects; rather I will say goodbye forever to Bitbucket.

Like # people like this
kerogos
Contributor
September 7, 2019

I start migrating repos to https://helixteamhub.cloud/, they support hg, svn, git. unfortunately they nonsupport online editing files, and i don't know if is connector from jira.  

Like Peter Koppstein likes this
John Arrizza
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 8, 2019

I have created a script that converts a mercurial repo to a git repo see below. It needs a few manual steps. 

# Steps:

0) print the repos so they can be checked off, one by one

    * list all Mercurial Repos
    * list all Git repos

Then for each mercurial repo:
 1) rename mercurial repo on bitbucket to "xx_hg" e.g. "my_cool_repo_hg"

 2) Create new git repo at Bitbucket called "xx" e.g. "my_cool_repo"


 3) run this script: ./convert_to_git <git_name>

  #assumes that the script below is called "convert_to_git" and is in the PATH

4) if all went well, delete mercurial repo on Bitbucker xx_hg
I want to keep this a manual step!

 

Can someone help automate the manual steps in bold?

 

 

============

# Copy this script into a file called convert_to_git and make sure it is in your PATH

 

set -x

# change this to your account name
my_account=<your_account_name>

repo_name=$1

echo "==== converting repo: ${repo_name}"
hg_name=${repo_name}_hg
git_name=$repo_name

hg_path=~/convert_to_git/$hg_name
mkdir -p ~/convert_to_git
cd ~/convert_to_git

hg clone ssh://hg@bitbucket.org/${my_account}/${hg_name}
echo " clone of hg repo: rc: $?"
pushd $hg_path

hg bookmark -r default master
hg push git+ssh://git@bitbucket.org:${my_account}/${git_name}.git
echo " hg push: rc: $?"

rm -rf .hg
rm -rf cmake-build-debug

git init
git remote add origin git@bitbucket.org:${my_account}/${git_name}.git
git add .

git pull origin master
git reset --hard HEAD
git push --set-upstream origin master
echo " git push1: rc: $?"

mv .hgignore .gitignore

git status
git add .
git commit -m "convert to git"
git push
echo " git push2: rc: $?"

popd

Like # people like this
torohill September 8, 2019

Perforce just posted this to their blog if anyone is interested:

https://www.perforce.com/blog/vcs/bitbucket-mercurial-support-ending

Like # people like this
jelmerjellema September 9, 2019

Hey Atlassian,

As I see iit, there will be two groups of HG-users: the ones that leave and the ones that would like to stay and switch their repos to git.

Are you planning to have a button "switch to git", that automatically uses a hg-to-git-converter to switch a repo to git? If so, I will wait for this button. If not I will either try to convert it myself, or just create a new GIT-repo, putting the .hg directory in the first commit, so I can check old versions and hg logs.

Will there be an automatic converter?

Regards, Jelmer

Vitaliy Kryvonos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 10, 2019

Wow. We are using Mercurial repositories for years and, when need create new repo, we still choose Mercurial over Git. That is a horrible news for us!

I do not understand why you, Atlassian, force us migrate by our selves? We have integration with Jira and planning to use Bamboo. So, we need to re-setup new git repositories again to use same Jira projects? Thank you a lot, you are a good helpers. At least I expect a "magic" button, which would do migration.

I'm sure you can easily migrate lot of existing repositories. Not all complex ones (with many integrations), but lot of others. Customers, who pays you money would appreciate that.

-tukanos-
Contributor
September 11, 2019

I was thinking hard why did Atlassian wants to get rid of mercurial when it has a) paying customers b) loyal community c) have already a product.  It just did not make any sense.

Yesterday it finally occurred to me.  The main reason, in my eyes, why Atlassian is decommissioning the mercurial is the Python 2.7 depreciation (EOL on January 1st, 2020).  The BB mercurial depreciation schedule is near match.

Atlassian decided they don't want to invest into moving from Python 2.7 to Python 3.x!  Simple as that.  They could have said so. 

I wonder if their mercurial solution will be open sourced or they are simply planning to delete it.

markand
Contributor
September 17, 2019

@-tukanos- 

Please note that Mercurial has official Python 3 support since 5.0 and will be default very soon :-).

Like sdvpartnership likes this
sdvpartnership
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 17, 2019

Thank you for continuing Mercurial development! We hope it will not disappear in the next years! Maybe you have the chance to persuade Facebook to create hg hosting service? 

-tukanos-
Contributor
September 18, 2019

@markand I think you misunderstood me.  I was not talking about mercurial itself (yes I have read the change log of the mercurial 5.x.  The 5.0 introduces a beta support for 3.x python, which is not what would you like on production).  I was talking about the whole BB environment which has been setup for Python 2.7, which would have to adapted, tested, maintained etc. (not mentioning any extensions they may have) for Python 3.x which is probably the main reason why Atlassian decided to shut it down.

Peter Koppstein
Contributor
September 19, 2019

Codebase has also put out the welcome mat for bitbucket refugees:
https://www.codebasehq.com/blog/looking-for-new-mercurial-hosting

davids_dad September 20, 2019

Can you help by answer a question, I have been looking for an answer to for some time.

How do I teach git to a teenager? I can not even teach it to my self. The internals are simple, but I have not found a user interface that I can use. I used tortoise for mercurial and svn, but git interfaces are terrible.

I have this question open at https://cseducators.stackexchange.com/q/2897/204 Maybe you can contribute an answer.

Alex Bream
Contributor
September 20, 2019

@davids_dad- I'm afraid, but "Git for teenagers" is almost "mission impossible" level of task (except case "they are tech-geeks on 150%"). For Git-GUIs, did you try:

  • SmartGit
  • GiKraken
  • Git Extensions
  • Tower
  • GitEye
Like Tara McGrew likes this
philipstarkey
Contributor
September 20, 2019

@davids_dad I've faced a similar issue finding a decent Git interface to replace TortoiseHg.

The best I've found so far is VS Code with the extensions "Git Graph" and "Git lens". 

  • VS Code has a commit window  built in that is not too dissimilar to TortoiseHg (you click a button to stage files - equivalent to selecting files to commit) and add a commit message.
    • There is also a button to initialise a new repository if your project is in a folder that does not have a git repository yet.

  • There is a menu with commands for push/pull in the same window as the above

  • The Git Graph extension provides an interface much like tortoisehg for viewing commit history, swapping to a particular version, etc.

  • You also get integration with your editor:
    • It shows you which lines of code have changed since the last commit and the diff
    • when a particular line was last changed

Importantly it's free, open source, and cross-platform (Windows/Mac/Linux - people have even managed to get it onto a raspberry pi which I know is used by a lot of educators).

 

Git-fork also looks very similar to tortoisehg, but doesn't work on Linux which is annoying.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events