~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-06-11 01:39:37 UTC
  • Revision ID: mbp@sourcefrog.net-20050611013937-fa6a4081ce78b100
- revision records include the hash of their inventory and
  of their predecessor.
  patch from John A Meinel

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        branch.inventory_store.add(inv_tmp, inv_id)
115
115
        mutter('new inventory_id is {%s}' % inv_id)
116
116
 
 
117
        # We could also just sha hash the inv_tmp file
 
118
        # however, in the case that branch.inventory_store.add()
 
119
        # ever actually does anything special
 
120
        inv_sha1 = branch.get_inventory_sha1(inv_id)
 
121
 
 
122
        precursor = branch.last_patch()
 
123
        if precursor:
 
124
            precursor_sha1 = branch.get_revision_sha1(precursor)
 
125
        else:
 
126
            precursor_sha1 = None
 
127
 
117
128
        branch._write_inventory(work_inv)
118
129
 
119
130
        if timestamp == None:
129
140
        rev = Revision(timestamp=timestamp,
130
141
                       timezone=timezone,
131
142
                       committer=committer,
132
 
                       precursor = branch.last_patch(),
 
143
                       precursor = precursor,
 
144
                       precursor_sha1 = precursor_sha1,
133
145
                       message = message,
134
146
                       inventory_id=inv_id,
 
147
                       inventory_sha1=inv_sha1,
135
148
                       revision_id=rev_id)
136
149
 
137
150
        rev_tmp = tempfile.TemporaryFile()