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 4081404
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:03:23+00:00 2026-05-20T18:03:23+00:00

I converted a Subversion repository to Mercurial a few months back and I wound

  • 0

I converted a Subversion repository to Mercurial a few months back and I wound up leaving two meaningless gaps in my revision history. I’m trying to figure out if I can just splice over the gaps, but I haven’t been able to get the tools to do precisely what I want.

I had reorganized the Subversion repo twice in the early days of the project: first to convert a single project root to trunk/branches/tags layout, and then to add a second related project in a second root folder with it’s own trunk/branches/tags.

By the time I decided to switch to Mercurial there had been no significant development activity outside of the trunk of the first, original project. I was able to use the Mercurial conversion utilities and path mapping to reassemble a single sensible trunk in the new Mercurial repository, or so I thought.

Now I realize that I have two extra heads, each corresponding to where the change history essentially starts over:

r0 ... r16 | (r17) r18 ... r61 | (r62) r63 ... tip

The results of the two revisions after the breaks, r17 and r62, are identical in content to the corresponding revision before the breaks — they consist entirely of file add operations with exactly the same contents as the previous revisions. Meaningful changes only start at the next revisions (r18 and r63 respectively).

I’ve messed with the Mercurial Transplant extension in an attempt to splice over r17 and r62, but it winds up concatenating the spliced changesets all the way at the tip of the default branch (r405 at this point).

These extra heads are not really hurting my development activities, so I’ve let it go for a while. What’s pushing me to resolve this is that MercurialEclipse complains about these extra heads every time I pull from my remote repository.

Can anyone offer any advice on how to approach this? Am I just getting the command flags wrong, or am I using the wrong tool? Should I be using the Rebase extension instead? What about some sort of dump-edit dumpfile-reload process that we all used to do with Subversion?

While I’ve published the project to my development server, there are only a couple of clones out there, so destroying those copies and recloning shouldn’t be a big deal.

  • 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-20T18:03:24+00:00Added an answer on May 20, 2026 at 6:03 pm

    The extension commands rebase and collapse should do the trick. Consider the following small repository as an example:

    $ hg glog -p
    
    o  changeset:   3:bc701d12d956
    |  tag:         tip
    |  summary:     hack
    |
    |  diff --git a/file b/file
    |  --- a/file
    |  +++ b/file
    |  @@ -1,1 +1,1 @@
    |  -hello world
    |  +hello big world
    |
    o  changeset:   2:2bb8c95d978e
       parent:      -1:000000000000
       summary:     history breaking svn reorganization
    
       diff --git a/file b/file
       new file mode 100644
       --- /dev/null
       +++ b/file
       @@ -0,0 +1,1 @@
       +hello world
    
    @  changeset:   1:b578b2ec776b
    |  summary:     hack
    |
    |  diff --git a/file b/file
    |  --- a/file
    |  +++ b/file
    |  @@ -1,1 +1,1 @@
    |  -hello
    |  +hello world
    |
    o  changeset:   0:c3d20f0b7072
       summary:     initial
    
       diff --git a/file b/file
       new file mode 100644
       --- /dev/null
       +++ b/file
       @@ -0,0 +1,1 @@
       +hello
    

    It basically resembles your situation, i.e. there are two unrelated lines of history, where the first revision of the second line (r2) is a plain add of everything present at the last revision of the first line (r1).

    You can put the second line onto the first one with rebase:

    $ hg rebase -s 2 -d 1
    $ hg glog
    
    @  changeset:   3:020d1b20caa8
    |  summary:     hack
    |
    o  changeset:   2:2a44eb4b74c3
    |  summary:     history breaking svn reorganization (empty changeset now)
    |
    o  changeset:   1:b578b2ec776b
    |  summary:     hack
    |
    o  changeset:   0:c3d20f0b7072
       summary:     initial
    

    As you see, the two lines have been joined. Revision 2 now is an obsolete empty changeset. You can get rid of it by using the collapse command to combine revisions 1 and 2:

    $ hg collapse -r 1:2
    <edit commit message>
    $ hg glog -p
    
    @  changeset:   2:d283fe96a5e6
    |  tag:         tip
    |  summary:     hack
    |
    |  diff --git a/file b/file
    |  --- a/file
    |  +++ b/file
    |  @@ -1,1 +1,1 @@
    |  -hello world
    |  +hello big world
    |
    o  changeset:   1:c486d8191bf0
    |  summary:     hack
    |
    |  diff --git a/file b/file
    |  --- a/file
    |  +++ b/file
    |  @@ -1,1 +1,1 @@
    |  -hello
    |  +hello world
    |
    o  changeset:   0:c3d20f0b7072
       summary:     initial
    
       diff --git a/file b/file
       new file mode 100644
       --- /dev/null
       +++ b/file
       @@ -0,0 +1,1 @@
       +hello
    

    Now the unrelated lines of history are joined in a meaningful way.

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

Sidebar

Related Questions

I converted a Subversion repository to Mercurial, using the Convert extension. When I look
We have a Mercurial repository converted from Subversion a while ago and have today
I would like to convert my Subversion repository to Mercurial. I have a pretty
I converted an old cvs repository into mercurial via hg convert . Everything seemed
I converted a Subversion repository to Git using git svn but unfortunately only now
I'm converting a big (with about 9000 changesets) Subversion repository to Mercurial. It is
I'm testing my new Git repository. I converted from Subversion to Git, no problem.
I'd like to convert a repository from Subversion to Mercurial, but when I initially
I need to convert an existing Mercurial repository to Subversion, I tried with the
I recently converted a subversion repo, which had been converted from cvs before that

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.