Hi all,
We are using TortoiseHg(Mercurial) as a sub version control in our project currently, we are now planning to migrate the sub version control to TFS 2013.
1. is this possible without the loss of any revisions that are exisitng.
2. is this possible without the loss of any logs or any kind of information that is there in the history.
3. What are the pre-requisites when it comes to hardware / software / personnel for this migration.
4. is there a tool which does this migration.

while was searching online, i got in touch with SVNBridge, but this actually supports TortoiseSVN, but am looking for TortoiseHg.

Any help appreciated.

Dani AI

Generated

Short expert summary and recommended approach (answering , building on ): migrating from Mercurial/TortoiseHg into TFS 2013 is doable, but the exact outcome depends on whether you move into a TFS Git repository (recommended) or into TFVC (centralized TFS version control). TFS 2013 supports hosting Git repos natively, so converting Hg→Git and then pushing into TFS Git is the simplest way to preserve commit history, authors and messages. (learn.microsoft.com)

Practical options and a quick workflow:

  • Preferred: convert Hg -> Git (use either the hg-git Mercurial plugin or the hg-fast-export tool), verify locally, then push the resulting Git repo into a TFS Git project. Example (high level):

    # option A: hg-git (from your Mercurial working copy)
    hg bookmark -r default master
    hg push git+ssh://<tfs-git-remote>
    
    # option B: hg-fast-export
    mkdir repo-git && cd repo-git
    git init
    hg-fast-export.sh -r /path/to/mercurial/repo
    git checkout
    git remote add origin <tfs-git-remote>
    git push --all origin

    Both hg-git and hg-fast-export are established tools for this conversion; hg-git can be bundled with TortoiseHg on Windows, while hg-fast-export gives more control for complex histories. Test on a clone first. (hg-git.github.io)

If you must end up in TFVC (not Git): convert Hg→Git, then use git-tfs to “replay” Git commits into TFVC (the rcheckin command can create one TFS changeset per Git commit). This preserves messages/authors when you provide an authors map, but TFVC will not keep Git/Mercurial native hashes and branch semantics differ — expect mapping work and possible manual fixes. Also watch for check-in policies and large-file/subrepo issues. (github.com)

Prereqs and tips: run the migration on a dedicated machine with plenty of disk space, keep a binary backup of the original Hg repo, install Mercurial/TortoiseHg, Git, Python/Dulwich (for hg-git) or hg-fast-export dependencies, and (if using TFVC) the Team Explorer/TFS object model and .NET for git-tfs. Validate branches, tags, LFS/large files and subrepos; make the old repo read-only after cutover and keep a mapping file of old→new IDs for traceability. (hg-git.github.io)

Recommended Answers

All 2 Replies

I beleive TFS has some sort of capability of importing git repositories, so you might have better luck going Mercurial -> Git -> TFS.

Hiroshe, thanks, that was one option i had.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.