/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/multiparent.py

  • Committer: Aaron Bentley
  • Date: 2007-08-15 01:11:27 UTC
  • mfrom: (2699 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2700.
  • Revision ID: aaron.bentley@utoronto.ca-20070815011127-0il5s8oqmt26bma7
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
                if block is None:
107
107
                    continue
108
108
                i, j, n = block
109
 
                while j + n < cur_line:
 
109
                while j + n <= cur_line:
110
110
                    block = cur_block[p] = next_block(p)
111
111
                    if block is None:
112
112
                        break
136
136
            diff.hunks.append(new_text)
137
137
        return diff
138
138
 
 
139
    def get_matching_blocks(self, parent, parent_len):
 
140
        for hunk in self.hunks:
 
141
            if not isinstance(hunk, ParentText) or hunk.parent != parent:
 
142
                continue
 
143
            yield (hunk.parent_pos, hunk.child_pos, hunk.num_lines)
 
144
        yield parent_len, self.num_lines(), 0
 
145
 
139
146
    def to_lines(self, parents=()):
140
147
        """Contruct a fulltext from this diff and its parents"""
141
148
        mpvf = MultiMemoryVersionedFile()
483
490
            pass
484
491
        diff = self.get_diff(version_id)
485
492
        lines = []
486
 
        reconstructor = _Reconstructor(self, self._lines,
487
 
                                       self._parents)
 
493
        reconstructor = _Reconstructor(self, self._lines, self._parents)
488
494
        reconstructor.reconstruct_version(lines, version_id)
489
495
        self._lines[version_id] = lines
490
496
        return lines
594
600
        while len(pending_reqs) > 0:
595
601
            req_version_id, req_start, req_end = pending_reqs.pop()
596
602
            # lazily allocate cursors for versions
 
603
            if req_version_id in self.lines:
 
604
                lines.extend(self.lines[req_version_id][req_start:req_end])
 
605
                continue
597
606
            try:
598
607
                start, end, kind, data, iterator = self.cursor[req_version_id]
599
608
            except KeyError: