~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Robert Collins
  • Date: 2005-09-30 14:27:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050930142741-fc326c828b5bbefd
text_version and name_version unification looking reasonable

Show diffs side-by-side

added added

removed removed

Lines of Context:
290
290
                assert hasattr(ie, 'revision'), \
291
291
                    'no revision on {%s} in {%s}' % \
292
292
                    (file_id, rev.revision_id)
293
 
                if ie.kind == 'file':
294
 
                    assert hasattr(ie, 'text_version')
295
293
 
296
294
        new_inv_xml = serializer_v5.write_inventory_to_string(inv)
297
295
        new_inv_sha1 = sha_string(new_inv_xml)
376
374
        for parent_inv in parent_invs:
377
375
            if parent_inv.has_id(file_id):
378
376
                parent_ie = parent_inv[file_id]
379
 
                old_text_version = parent_ie.text_version
380
 
                assert old_text_version in self.converted_revs 
381
 
                if old_text_version not in file_parents:
382
 
                    file_parents.append(old_text_version)
 
377
                old_revision = parent_ie.revision
 
378
                # if this fails, its a ghost ?
 
379
                assert old_revision in self.converted_revs 
 
380
                if old_revision not in file_parents:
 
381
                    file_parents.append(old_revision)
383
382
                if parent_ie.text_sha1 != ie.text_sha1:
384
383
                    text_changed = True
385
384
        if len(file_parents) != 1 or text_changed:
387
386
            assert sha_strings(file_lines) == ie.text_sha1
388
387
            assert sum(map(len, file_lines)) == ie.text_size
389
388
            w.add(rev_id, file_parents, file_lines, ie.text_sha1)
390
 
            ie.text_version = rev_id
 
389
            ie.revision = rev_id
391
390
            self.text_count += 1
392
391
            ##mutter('import text {%s} of {%s}',
393
392
            ##       ie.text_id, file_id)
394
393
        else:
395
394
            ##mutter('text of {%s} unchanged from parent', file_id)
396
 
            ie.text_version = file_parents[0]
 
395
            ie.revision = file_parents[0]
397
396
        del ie.text_id
398
397
 
399
398