~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to multiparent/__init__.py

  • Committer: Aaron Bentley
  • Date: 2007-04-11 20:03:40 UTC
  • mto: (2520.4.1 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070411200340-81f58wipd7jpeoe7
Dynamically select snapshots based on all parents

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
        for ignored in xrange(self.snapshot_interval):
183
183
            if len(parent_ids) == 0:
184
184
                return False
185
 
            version_id = parent_ids[0]
186
 
            if version_id in self._snapshots:
187
 
                return False
188
 
            parent_ids = self._parents[version_id]
 
185
            version_ids = parent_ids
 
186
            parent_ids = []
 
187
            for version_id in version_ids:
 
188
                if version_id not in self._snapshots:
 
189
                    parent_ids.extend(self._parents[version_id])
189
190
        else:
190
191
            return True
191
192
 
221
222
            pass
222
223
        diff = self._diffs[version_id]
223
224
        lines = []
224
 
        reconstructor = _Reconstructor(self._diffs, self._lines, self._parents)
 
225
        reconstructor = _Reconstructor(self._diffs, self._lines,
 
226
                                       self._parents)
225
227
        reconstructor.reconstruct_version(lines, version_id)
226
228
        self._lines[version_id] = lines
227
229
        return lines
240
242
        """Append the lines referred to by a ParentText to lines"""
241
243
        parent_id = self.parents[version_id][parent_text.parent]
242
244
        end = parent_text.parent_pos + parent_text.num_lines
243
 
        return self._reconstruct(lines, parent_id, parent_text.parent_pos, end)
 
245
        return self._reconstruct(lines, parent_id, parent_text.parent_pos,
 
246
                                 end)
244
247
 
245
248
    def _reconstruct(self, lines, req_version_id, req_start, req_end):
246
249
        """Append lines for the requested version_id range"""