I fully support the migration to git. But deleting user repositories feels like a punch in my face. Yet we will have no choice but bow to your commands and migrate everything to github.
There is also another tool (https://github.com/clach04/bitbucket_tools/blob/master/dump_repos.py) in the repo that will export only. It exports more items (metadata, logo, issues, downloads) in a one-shot than any of the other tools. It would be nice to combine some of the tools but there are some incompatibilities in approaches. The following:
FWIW github's hg importer messes up the order of merge parents - it ends up looking like master was merged into feature branches instead of the other way around. This can make diffs of merge commits be completely useless unless you manually reason about which head was master at the time and diff to the right parent. So it's not great if you're converting a branchy repository.
If you use bookmarks in mercurial, hg-fast-export can't deal with them though. I made a tool that wraps hg-fast-export, first converting bookmarks to named branches so it can deal with them:
If you're hosting Maven projects on Bitbucket, and are looking to convert them to Git and move them to Github, I have written a converter that will translate the pom.xml <scm>...</scm> block from Mercurial/Bitbucket to Git/Github. So, it'll translate:
I've use https://github.com/new/import to convert several repositories so far. It works well, all branches, history, etc, seem to be intact. I then would import the repo back to bitbucket. When you create a new BB repo there is a link at the top of the page to import. It's worked well for me. You'll need to turn off 2 factor in BB.
What an utterly careless move. How can you decide to do this without a tool to convert a repo in place?
Since I have to do everything myself, I follow many previous commenters' recommendation and move to github.
Byebye Bitbucket - and byebye trust in Atlassian. You have lost a well networked evangelist. I had recommended Atlassian products in the past - and won't anymore.
We used Lorenzo Mori's method to pull the HG repo out and create a GIT version. The HG repo's we had weren't too complex but it preserved things like tags and branches.
Bye, everyone - I've successfully migrated everything to https://github.com/devzendo with the aid of Magnus Hovland Hoff's https://magnushoff.com/blog/kick-the-bitbucket/ 'Kick the Bitbucket' script (which did the job superbly), and the scripts I published (see earlier) to change .hgignore to .gitignore, and update Maven pom.xml SCM blocks.
I'm sad to say goodbye to Mercurial; I find it far easier to use than git. Git's user interface is brutally incoherent. Oh well..
On the plus side, since moving to Github, my projects have been found by other users, starred, and I've been contacted by interested users. It really is 'social code hosting'!
Thank you once more Atlassian, for hosting my code since Google Code closed. I wish you luck with this strategy.
While the development of hg-git is quite active sometimes its a little bit tricky to find a working set of versions for: hg, hg-git and dulwich. The last problem I had was that I can clone a github repo via https but I had an error on push via the https url. My workaround was to first clone the repo with git and then clone it again locally with hg.
Regardless of this workaround I like it very much to work on a github-repo with mercurial.
I'm a scientist, and, just like many other researchers, I have links to some of my Bitbucket mercurial repositories in academic papers, which are impossible to change. Regardless of whether I choose to move my repositories to another platform or to turn them into Bitbucket git repositories, a problem remains: the links in my papers will lead nowhere. I would really appreciate it if Atlassian at least added an option of permanently redirecting the old repository URLs to the up-to-date git versions of those repositories. That way, the old links will resolve to something, and Atlassian still won't have to bother with keeping mercurial stuff alive.
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
The trick is that you need to delete your repos before Atlassian does: When you do this you can specify an URL to redirect to. Thus your repo URLs will continue to live as redirects.
@Zoltán LehóczkyThanks for the tip! I didn't know that, and it looks like a solution. However, it's not clear if that redirect survives when the underlying repository is deleted by Atlassian. If that is the case, it would be nice if they stated that explicitly somewhere.
@timarkh One option could be to delete your hg repository and create a new git repository with the same name (this is possible because it is what Atlassian tells you to do - they just leave the conversion step to you). If, like me, you are planning on moving your repository somewhere else, rather than converting it to a BitBucket git repository, then just place a readme.md file in your empty bitbucket git repository with a link to your new repository hosting for people to follow.
This way you maintain ownership of a repository at the location referenced by your papers, and can redirect visitors as appropriate via an arbitrary message you have control over (in the readme.md file)
@AmberVH Is there any updates in the Bitbucket's timeline for sunsetting the Mercurial support due to the evolving situation of Coronavirus?
We had to divert our team leading the support for Mercurial to Git migration to help with technicalities evolved due to Coronavirus outbreak. That is weeks if not months of time we couldn't dedicate to the migration. And now we are in a situation where we are cutting it too close with the June 1, 2020 deadline.
I assume different organizations are suffering from the same issue.
531 comments