My scenario is as follows.
The project I have cloned from was originally versioned using Mercurial and I have a clone of that original repo with all it's history.
At a certain point in time the owner of the project decided to move to GitHub but has lost all the history in the move so this new repo, although it's a continuation of the old project, is effectively starting anew from revision 0.
I want to stick with Hg, and Hg-Git will obviously allow me to pull from the Git repo, but what I don't know how to do is to stick together the head of the Hg repo with the tail of the Git repo so I can just carry on pulling down regular updates as before.
The actual commit in Git that matches the head of the Hg repo is not the first commit, so it's not the tip of the tail.
I thought that hg convert and --splicemap might be useful, but the more I've read about it the less it looks like a solution for me.
Can anyone offer any suggestions as to how I can achieve this?
Update
Just for the information of anyone who might be trying to do something similar, I finally managed to achieve the result I wanted but it was a long and winding road, and it turns out that hg convert and splicemap was the answer after all.
- I pulled down the Git repo from Github with the hg-git plugin.
- Then I cloned that to a new repo and pulled in the related but disconnected Hg repo contents using hg pull --force.
So now I have a repo with 2 distinct branches of development which have no common ancestor as far as the repo is concerned, I'm going to refer to this as the hydra.
- Using hg convert and splicemap I joined the branches at the matching point in the history into a new repo, and then ran hg strip to get rid of the stray unnecessary bits.
- The trick however was that the original Git repo will be updated and I wanted to be able to pull in the new changes to this joined up repo.
The solution? Batch files.
Yeah you heard right, batch files.
The solution was effectively a set of 3, first to pull from Github to the repo that just holds the Git repo. Second pulled from the Git repo into the hydra (the Hg source isn't going to change so I don't need to pull from that again). Third re-ran the hg convert command so that it updates the joined repo with the new information from the hydra.
It's unpleasant, it's long winded and it was a bit of a nightmare to set up, but it works cleanly now and my final repo is a predictable and reasonable size.