~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to multiparent/__init__.py

  • Committer: Aaron Bentley
  • Date: 2007-04-12 04:39:21 UTC
  • mto: (2520.4.1 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: aaron.bentley@utoronto.ca-20070412043921-nl2n5ez9pl4m8vxj
Fix restoration bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
        self._parents[version_id] = parent_ids
243
243
 
244
244
    def import_versionedfile(self, vf, snapshots, no_cache=True,
245
 
                             single_parent=False):
 
245
                             single_parent=False, verify=False):
246
246
        """Import all revisions of a versionedfile
247
247
 
248
248
        :param vf: The versionedfile to import
252
252
        :param single_parent: If true, omit all but one parent text, (but
253
253
            retain parent metadata).
254
254
        """
 
255
        assert no_cache or not verify
255
256
        revisions = set(vf.versions())
256
257
        total = len(revisions)
257
258
        pb = ui.ui_factory.nested_progress_bar()
273
274
                    added.add(revision)
274
275
                    if no_cache:
275
276
                        self.clear_cache()
 
277
                        if verify:
 
278
                            assert lines == self.get_line_list([revision])[0]
 
279
                            self.clear_cache()
276
280
                    pb.update('Importing revisions',
277
281
                              (total - len(revisions)) + len(added), total)
278
282
                revisions = [r for r in revisions if r not in added]
327
331
            except KeyError:
328
332
                iterator = self.diffs[req_version_id].range_iterator()
329
333
                start, end, kind, data = iterator.next()
 
334
            if start > req_start:
 
335
                iterator = self.diffs[req_version_id].range_iterator()
 
336
                start, end, kind, data = iterator.next()
 
337
 
330
338
            # find the first hunk relevant to the request
331
339
            while end <= req_start:
332
340
                start, end, kind, data = iterator.next()