Import TFS History into Mercurial (hg)
Asked Answered
P

6

17

Has anyone had any success importing TFS 2008 history into a new Mercurial repository?

The only possible solution I've found to date is to go TFS -> svn -> hg using tfs2svn and then using the Convert Extension but I haven't tried this yet.

Plasticine answered 25/6, 2009 at 21:4 Comment(1)
There's a Stack Exchange proposal for a Visual Studio ALM Q&A site that you can help to go live: area51.stackexchange.com/proposals/15894Midwest
G
9

Here's a blog post on converting TFS to Mercurial from someone who has converted many projects: http://blog.eworldui.net/post/2010/03/16/Mercurial-Conversion-from-Team-Foundation-Server.aspx

Gigue answered 22/3, 2010 at 2:47 Comment(0)
C
7

I just put together a simple tool that synchronizes changesets from TFS to Hg for a single branch, using TF.exe and HG.exe.

http://bitbucket.org/rojepp/tfstohg

Update: The F# port of the tool is more stable and less resource intensive than the C# version: http://bitbucket.org/rojepp/tfstohgfs/

Cammi answered 15/10, 2010 at 6:0 Comment(2)
Thanks Mark! Nice to hear that it's been of use to someone.Cammi
Works great! Much easier than going thru SVN, especially when you have multi-GB repositoryDoubletongued
G
3

The latest build of SvnBridge was updated to better support using the hg convert command. So we've been using hg convert with SvnBridge now and for most projects it has been working perfectly.

Gigue answered 27/1, 2010 at 21:46 Comment(0)
C
2

I couldn't sleep during the weekend, and couldn't get the TFS->SVN->Hg solutions to work reliably, so I wrote a tool for doing exactly this: Tfs2Hg

Cosmetic answered 18/10, 2010 at 8:2 Comment(1)
I have tried both TFS -> svn -> hg as well as Tfs2Hg. But unfortunately, both these solutions don't take branches into account. I mean the branches and their changeset history get migrated fine. But the parent-child link between the branches is not established in the migrated repository. I am yet to look into the SvnBridge approach. Any ideas on how I could get the branching information to be migrated properly as well? ThanksWalli
S
1

The convert extension does not support TFS (as of Mercurial 2.0).

If you can convert to Subversion first, then that is a good option.

This is not unusual — when converting from CVS, some users report better results by first using one of the highly tuned CVS to SVN converters out there, and then converting from SVN to Hg. So don't feel bad about taking this "detour" :-)

Sauls answered 25/6, 2009 at 21:8 Comment(3)
TFS = Microsoft's Team Foundation ServerDownward
A bit late in the day, I know - but come on... TFS was around since 2005. Or was this some kind of joke I've failed to pick up?Kylstra
Assaf: I'm an open source guy and that is why I hadn't heard about TFS back in 2009. Since then Microsoft added support for Mercurial to their Codeplex site and I read about TFS through that. There is still no built-in converter from TFS, though. If you use TFS, then please help us by writing one!Sauls
S
0

Either tfs2svn or use Mercurial Convert extension to convert through SvnBridge directly.

Sperry answered 27/12, 2009 at 22:53 Comment(2)
It was a long time ago now, but I tried both of those things and neither worked. I think my TFS repository was just too large. It's possible they've been improved enough to work now but I couldn't say.Plasticine
If you know Python and TFS allows to fetch commits one by one, you can add TFVC source to Tailor, so you can convert your code to Mercurial or any other supported VCS: ArX, Bazaar, Codeville, CVS, Cogito, Darcs, Monotone and Subversion - progetti.arstecnica.it/tailor/wikiSperry

© 2022 - 2024 — McMap. All rights reserved.