6

I have a windows machine with atlassian "sourceTree". The repo is synced to bitbucket.

I have a linux machine synced to the same repo. The linux machine is on revision 138.

I forgot to pull a revision, because the commit 138 on the linux machine created a new head with revision 137 on the windows machine.

screen dump from sourcetree I have made some changes on the windows machine and now have two heads.

When I try to merge I get this error:

hg merge -y ui.merge=internal:merge default abort: merging with a working directory ancestor has no effect Completed with errors, see above.

I have no idea what that means. I thought that I would be asked about which files to keep etc.

Andreas
  • 6,612
  • 14
  • 59
  • 69
  • 2
    Sounds like you did not specify what 2 things to merge correctly. Me merged with my greatgrandpa is the same as Me, which makes little sense to do. Me merged with a great uncle would effectively add the changes between greatgrandpa and the uncle to me. – storm Apr 03 '17 at 17:26
  • Possible duplicate of [Mercurial Merge of Two Named Branches: Working Directory Has No Ancestor](https://stackoverflow.com/questions/12310131/mercurial-merge-of-two-named-branches-working-directory-has-no-ancestor) – Coby Viner Oct 20 '18 at 23:25

2 Answers2

4

My solution.

I updated to the revision that went wrong. From there I could do the merge.

I don't know why - but it did work.

Andreas
  • 6,612
  • 14
  • 59
  • 69
3

The solution we came up with to this same, somewhat baffling error, was simply to "touch" the older head, as in do a dummy commit, and then we were able to do the merge.

I still don't understand what caused this, but making a token update to the branch that wouldn't merge allowed us to merge them.

I hope that helps someone!

Martin
  • 31
  • 1
  • This helped me - it allowed me to merge the "problem" branch. Strangely, we had two heads on default and it wasn't complaining, and I don't remember forcing... maybe there's a bug in Mercurial ? – O'Rooney Oct 16 '18 at 01:00