"git-hg push" creates new Mercurial head
Hello,
I'm using git hg to interact with a Google code repository. However, if I try to push my changes back to mercurial, I create a new head (wich is a clone of the branch I'm working on + my changes).
The only workaround I found was forcing the push and then closing the duplicated branches...
//I had to force the cloning, otherwise I would get no files at all $git hg clone --force https://(google-username)@code.google.com/p/scalasmt/
$git commit
$git hg push scanning source...(google-username)@code.google.com/p/scalasmt/ searching for changes abort: push creates new remote head (hash)! (did you forget to merge? use push -f to force)
Got same problem - anyone has any idea how to fix?
+1
Same here, it complains about new remote heads (when it shouldn't), then if try to force, it replicates the whole tree in a new "branch". The new tree looks like this, notice the first commit's parent:
o changeset: 4:018cee199382
| tag: tip
| parent: 2:b3ad305ef945
| user: Oscar Morante <[email protected]>
| date: Fri Nov 08 09:10:30 2013 +0100
| summary: poiu
|
| o changeset: 3:d464b70dfcb1
|/ user: Oscar Morante <[email protected]>
| date: Thu Nov 07 18:36:03 2013 +0100
| summary: qwer
|
o changeset: 2:b3ad305ef945
parent: -1:000000000000
user: Oscar Morante <[email protected]>
date: Thu Nov 07 18:35:28 2013 +0100
summary: asdf
And this is the original tree:
@ changeset: 1:47f4590483fb
| branch: feature-branch
| user: Oscar Morante <[email protected]>
| date: Thu Nov 07 18:36:03 2013 +0100
| summary: qwer
|
o changeset: 0:bc22880425b1
user: Oscar Morante <[email protected]>
date: Thu Nov 07 18:35:28 2013 +0100
summary: asdf
I think the problem is that 'hg convert' is generating different hashes than fast-export for some reason. I'm using Mercurial 2.7.2, from Debian repositories.
I think this is really a sign that this approach for doing pushes is not really workable. There is another approach taken by git-hg-again that uses the same library used by hg-git but in reverse, which honestly might be a better approach if hg-convert doesn't round-trip properly.
So I just updated to the latest fast-export. I really doubt that this will help much, since I think the problem is on the hg convert side, but it might be worth trying.
Any confirmation of this issue? I would like to choose a tool for using hg from git now. Curious to know since this is a vital feature. Thanks.
If you need a tool to seriously use hg bi-directionally from git, this is probably not the right tool for you, and it's unlikely to get there unless someone that really cares about that problem steps up. In the mean time git-hg-again might prove useful to you.