Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 556609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:56:16+00:00 2026-05-13T11:56:16+00:00

I’d like to convert a repository from Subversion to Mercurial, but when I initially

  • 0

I’d like to convert a repository from Subversion to Mercurial, but when I initially set up the repository, I did it in the laziest way possible. Over time, the structure continued to morph and deteriorate (it’s 5 years old at this point). Nevertheless, I’d like to preserve as much history as possible, even if I have to get dirty and manually stitch things back together.

Without further ado, the current structure looks like so:

svn://svn.example.com/Example
    + trunk
        + BigProject
        + BinaryDepedencies
    + branches
        + BigProject
            + branch1
            + feature1
            + maintenance1
            + ...
    + tags
        + BigProject
            + tag1
            + tag2
            + ...
    + projects
        + small_project1
        + small_project2
        + small_project3
        + ...

Given that this is just the most recent structure, is there any hope for this repository? If there is no hope, anyone have a good approach for rebuilding the history by hand in Mercurial (or bazaar).

Also, for various reasons, I won’t be able use git unless there is a bulletproof strategy to convert this specific repo from Subversion to git to hg/bzr.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:56:17+00:00Added an answer on May 13, 2026 at 11:56 am

    One strategy might be to convert the trunk. You might have to play some games if your trunk has moved, but it shouldn’t be too hard.

    Another tool in your arsenal might be hg->hg conversion and the rebase extension. You can use those to fiddle around with your tree after you have things in an hg repository and graft on branches after you’ve converted them. Or graft in new pieces of your trunk history after its moved.

    Here is a nice link to documentation on the Mercurial rebase extension.

    Basically, here’s the strategy you would follow… First, use the convert extension or hgsvn to convert parts of the repository. This may result in multiple lines of trunk, or in branches that are in a separate repository from the mainline.

    If you have two sections of trunk in separate repositories and the one in the directory called second directly follows the one in the directory called first, you can do this:

    cd second
    hg log -r 0
    # Note the revision hash
    cd ../first
    hg tip
    # Again, note the revision hash
    hg pull -f ../second
    hg rebase --source <revision hash from hg log -r 0> --dest <revision hash from hg tip>
    

    That will graft one section of trunk onto another section of trunk.

    If you have a branch in a separate repository, the procedure is slightly trickier:

    cd branch
    hg log -r 0
    # Note the revision hash
    cd ../trunk
    # Find the revision that the branch branches off from and note its hash.
    # We will call this revision the 'branch base'.
    hg pull -f ../branch
    hg rebase --source <revision hash from hg log -r 0> --dest <revision hash of branch base>
    

    That will graft the branch onto the main tree.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.