Unexpected result from bzr merge: line missing?

Terry Jones terry at jon.es
Wed Jul 28 18:23:13 BST 2010


I've just run into something odd using bzr merge, and after asking a few
people to look at it have decided to post a summary here to see if anyone
can point out what I'm doing wrong. I'm running Hardy with:

$ bzr --version
Bazaar (bzr) 2.1.2
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib/python2.5
  Platform: Linux-2.6.24-28-generic-x86_64-with-debian-lenny-sid
  bzrlib: /usr/lib/python2.5/site-packages/bzrlib


I have two branches. In the trunk, I have file.py with the following (line
numbers included for discussion):

   416              about = guessValue(about)
   417              if about:
   418                  result.about = about.encode('utf-8')

Whereas in the branch, I have:

   407              if about:
   408                  about = guessValue(about)
   409                  if about:
   410                      result.about = about

If I do a diff of trunk branch, I see:

416c406
<             about = guessValue(about)
---
>
418c408,410
<                 result.about = about.encode('utf-8')
---
>                 about = guessValue(about)
>                 if about:
>                     result.about = about

Which appears correct.  Note that line 416 of the trunk is clearly present
in the diff.

Now if I cd into the branch and do a bzr merge on the branch, the output
looks like this:

   408
   409              if about:
   410  <<<<<<< TREE
   411                  about = guessValue(about)
   412                  if about:
   413                      result.about = about
   414  =======
   415                  result.about = about.encode('utf-8')
   416  >>>>>>> MERGE-SOURCE


Which looks wrong, because line 416 from the trunk will not be present if I
take the changes from MERGE-SOURCE (trunk). I.e., I'd wind up with:

   416
   417              if about:
   418                  result.about = about.encode('utf-8')

So where did the "about = guessValue(about)" line from the trunk go?
Experience tells me the fault must be mine, but I don't see how. The diff
clearly shows the about = guessValue(about) as being present only in the
trunk at that point in the file, but it looks like bzr merge is not
interpreting the diff output correctly.

I get the same result with the various different merge algorithms.

Thanks for any help!

Terry Jones



More information about the bazaar mailing list