Warz
Warz

Reputation: 7776

Merging pushed named branch with default causes error

I created a named branch using the mercurial eclipse plugin 20111225_Content_Build and after committing this branch locally, i pushed to my bitbucket repository without first merging with default. Now i have the default (inactive) and my named branch 20111225_Content_Build (active). I tried to merge these two following these steps:

hg update default

This gives me an error: abort: untracked file in working directory differs from file in requested revision: 'target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml'

and then when i try to merge: hg merge 20111225_Content_Build i get an error stating that i cannot merge with a working directory?

abort: merging with a working directory ancestor has no effect

I do have several generated target/ files that have not been committed or pushed, do i need to push these files in order to merge these two branches?

Upvotes: 2

Views: 3153

Answers (1)

Ry4an Brase
Ry4an Brase

Reputation: 78350

The message when you update is telling you your pom.xml files is not added in your branch, but is added in default. So when you hg update default Mercurial would need to discard the changes in your pom.xml file and overwrite it with the version that's checked-in in default, but Mercurial always refused to throw away data unless you really, really insist.

You've got two easy options:

If you want to keep the changes you made to pom.xml in the branch and merge them into the pom.xml stored in the default branch then you do this:

  • hg add target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml
  • hg commit target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml

If (instead) you want to discard the changes to pom.xml in the branch then just do this:

  • rm target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml

After either one of those you'll be able to do:

  • hg update default
  • hg merge 20111225_Content_Build

Upvotes: 4

Related Questions