~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Martin Pool
  • Date: 2005-09-16 09:39:37 UTC
  • Revision ID: mbp@sourcefrog.net-20050916093937-026fbeac6ee725b7
- InventoryEntry.copy() should copy entry version

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
                
20
20
import bzrlib.errors
21
21
import bzrlib.progress
22
 
from bzrlib.xml4 import serializer_v4
 
22
from bzrlib.xml import serializer_v4
23
23
 
24
24
 
25
25
def upgrade(branch):
75
75
                updated = True
76
76
                mutter("  set inventory_sha1 on {%s}" % rev_id)
77
77
 
 
78
            for prr in rev.parents:
 
79
                try:
 
80
                    actual_sha1 = branch.get_revision_sha1(prr.revision_id)
 
81
                except bzrlib.errors.NoSuchRevision:
 
82
                    mutter("parent {%s} of {%s} not present in branch; skipped"
 
83
                           % (prr.revision_id, rev_id))
 
84
                    continue
 
85
                    
 
86
                if actual_sha1 != prr.revision_sha1:
 
87
                    mutter("parent {%s} of {%s} sha1 mismatch: "
 
88
                           "%s vs %s; fixed"
 
89
                           % (prr.revision_id, rev_id,
 
90
                              actual_sha1, prr.revision_sha1))
 
91
                    prr.revision_sha1 = actual_sha1
 
92
                    updated = True
 
93
 
78
94
            if updated:
79
95
                updated_previous_revision = True
80
96
                # We had to update this revision entries hashes