~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Martin Pool
  • Date: 2006-03-03 09:56:52 UTC
  • mfrom: (1588 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1593.
  • Revision ID: mbp@sourcefrog.net-20060303095652-a0f4f293dad83a04
[merge] sync from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
279
279
 
280
280
        # if we abort after here the (in-memory) weave will be corrupt because only
281
281
        # some fields are updated
 
282
        # XXX: FIXME implement a succeed-or-fail of the rest of this routine.
 
283
        #      - Robert Collins 20060226
282
284
        self._parents.append(parents[:])
283
285
        self._sha1s.append(sha1)
284
286
        self._names.append(name)
318
320
        # another small special case: a merge, producing the same text
319
321
        # as auto-merge
320
322
        if text == basis_lines:
321
 
            return new_version            
 
323
            return new_version
322
324
 
323
325
        # add a sentinal, because we can also match against the final line
324
326
        basis_lineno.append(len(self._weave))
746
748
 
747
749
 
748
750
 
749
 
    def weave_merge(self, plan):
 
751
    def weave_merge(self, plan, a_marker='<<<<<<< \n', b_marker='>>>>>>> \n'):
750
752
        lines_a = []
751
753
        lines_b = []
752
754
        ch_a = ch_b = False
768
770
                elif lines_a == lines_b:
769
771
                    for l in lines_a: yield l
770
772
                else:
771
 
                    yield '<<<<<<<\n'
 
773
                    yield a_marker
772
774
                    for l in lines_a: yield l
773
775
                    yield '=======\n'
774
776
                    for l in lines_b: yield l
775
 
                    yield '>>>>>>>\n'
 
777
                    yield b_marker
776
778
 
777
779
                del lines_a[:]
778
780
                del lines_b[:]