0

I have merged two repositories together with the mqextension, giving me a repository that looks like this:

.. [a] --- [b] --- [c] --- [d]<- default branch
                  / 
       [x] --- [y] <- feature branch

The problem is that when I try to push this I get:

hg push --new-branch
abort: push creates new remote head x!
(did you forget to merge? use push -f to force)

How can I fix this? I assume I need to merge [a] with [x] so that I have a common ancestor. Is this possible? would I cause issues if I just forced the push?

EDIT - After a little more research I found I was trying to simplify the repository a little too much.. the repository looks like this:

.. [a] --- [b] --- [c] --- [d]<- default branch
      \                   
       [f] --- [g] --- [z] <- integration branch
                      / 
           [x] --- [y] <- feature branch
          /
       [w] <- default branch from old repository.

I think what is happening is that I have two heads for the default branch and hg doesn't want to push both of them to master.

Should I merge the two defaults together?

metrix
  • 1,486
  • 2
  • 11
  • 19
  • Is time really flowing right-to-left in your graph? That is, is `[a]` and `[x]` heads and `[d]` is the common root? From the error message is sounds like that is the case, but you talk about adding a common *ancestor* to `[a]` and `[x]`. So I'm confused :) – Martin Geisler Aug 29 '12 at 08:34
  • Not sure if I am describing time the best way, but time is in the order of the letters, so [d] was committed before [f] and [w]. Let me know if I need to modify the graph to be more descriptive. – metrix Aug 30 '12 at 14:19

1 Answers1

0

There's no reason why merging two unrelated repositories should cause this problem. I have just tried it and it pushed with no issue at all.

If time flows from left to right in your graph then you only have the one head [d]. That graph looks as I would expect it to after the merging of two repos.

The error message looks like someone else has pushed changes to the central repository and so you'd need to do hg pull and hg merge to merge their changes into your branch.

EDIT - After your edit adding more info it seems like you do actually have two heads on the default branch and, yes, you should merge them with hg merge.

Steve Kaye
  • 6,262
  • 2
  • 23
  • 27
  • I think OP's graph is backwards. It's the only explanation for `push creates new remote head x!`. I couldn't reproduce it going left-to-right. – Mark Tolonen Aug 29 '12 at 12:57
  • I think that the OP's graph is going forward in time left to right because he said that he'd merged two unrelated repositories and that's what the graph looks like when you do that. The explanation for the error could be the standard explanation which is that someone else has pushed their changes. – Steve Kaye Aug 29 '12 at 13:10
  • Yes, likely the OP substituted `x` in the error message for a changeset that actually corresponds to `[d]` and not `[x]`. Then left-to-right would make sense. Maybe s/he will enlighten us. – Mark Tolonen Aug 29 '12 at 13:32
  • Currently I am the only one pushing to the repository. After I get all of this ironed out, the team will be using the repository. – metrix Aug 30 '12 at 14:17