Hello-World
Hello-World

Reputation: 9555

bzr merge - three files made what do I do?

Sometime when I merge in bazaar it says that I have a conflict. my files name is myfile.txt

I see that I am given three extra files . where did they come from?

myfile.BASE

myFile.THIS

myFile.OTHER

What do I do now?

I see in the documentation I need to pick one.

So if I choose BASE, do I rename myfile.BASE to myfile mv myfile.BASE myfile then what? I'm unclear what to do? I see bzr resolve delete these extra files, what about bzr commit

Thanks again for the help

Upvotes: 1

Views: 466

Answers (1)

janos
janos

Reputation: 124704

This looks like a case of a text conflict: your current branch and the other branch (the "merge source") both made some change in myFile at around the same lines. You have to resolve this manually. To help you, Bazaar created some extra files:

  • myFile.BASE: this is the version of myFile as it was in the last common revision X of the two branches. After revision X, the two branches changed the file in a conflicting way.
  • myFile.THIS: this is the version of myFile as it was in the current branch before you did bzr merge
  • myFile.OTHER: this is the version of myFile as it is in the other branch (the "merge source"), where you are merging from

Furthermore, myFile itself is edited, with so-called "fishbone" markers inside (<<<<<<< and >>>>>>> and =======) to mark the regions in the file coming from changes in the current branch or the other.

These files are for your reference, to help you resolve the conflict. In some cases the solution is simply to take changes from one branch and disregard the other. The bzr resolve command has some helpful flags for that:

  • bzr resolve --take-this myFile -- will resolve the conflict in myFile by taking changes from the current branch, ignoring the other
  • bzr resolve --take-other myFile -- likewise, taking changes from the other branch

But most often you need to edit myFile, review the regions marked with <<<<<<< and >>>>>>>, make the necessary corrections and remove the markers manually. After the file is correct, you can run bzr resolve myFile to tell Bazaar that you have manually resolved the conflict.

Or, you can abort the merge with bzr revert.

For more details, see the documentation:

Upvotes: 1

Related Questions