~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

 * The internal storage of history, and logical branch identity have now
   been split into Branch, and Repository. The common locking and file 
   management routines are now in bzrlib.lockablefiles. 
   (Aaron Bentley, Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
        mutter('preparing to commit')
203
203
 
204
204
        self.branch = branch
205
 
        self.weave_store = branch.weave_store
 
205
        self.weave_store = branch.repository.weave_store
206
206
        self.rev_id = rev_id
207
207
        self.specific_files = specific_files
208
208
        self.allow_pointless = allow_pointless
290
290
        """Store the inventory for the new revision."""
291
291
        inv_text = serializer_v5.write_inventory_to_string(self.new_inv)
292
292
        self.inv_sha1 = sha_string(inv_text)
293
 
        s = self.branch.control_weaves
 
293
        s = self.branch.repository.control_weaves
294
294
        s.add_text('inventory', self.rev_id,
295
295
                   split_lines(inv_text), self.present_parents,
296
296
                   self.branch.get_transaction())
319
319
            self.parents.append(precursor_id)
320
320
        self.parents += pending_merges
321
321
        for revision in self.parents:
322
 
            if self.branch.has_revision(revision):
323
 
                self.parent_invs.append(self.branch.get_inventory(revision))
 
322
            if self.branch.repository.has_revision(revision):
 
323
                inventory = self.branch.repository.get_inventory(revision)
 
324
                self.parent_invs.append(inventory)
324
325
                self.present_parents.append(revision)
325
326
 
326
327
    def _check_parents_present(self):
327
328
        for parent_id in self.parents:
328
329
            mutter('commit parent revision {%s}', parent_id)
329
 
            if not self.branch.has_revision(parent_id):
 
330
            if not self.branch.repository.has_revision(parent_id):
330
331
                if parent_id == self.branch.last_revision():
331
332
                    warning("parent is missing %r", parent_id)
332
333
                    raise HistoryMissing(self.branch, 'revision', parent_id)
348
349
        rev_tmp.seek(0)
349
350
        if self.config.signature_needed():
350
351
            plaintext = Testament(self.rev, self.new_inv).as_short_text()
351
 
            self.branch.store_revision_signature(gpg.GPGStrategy(self.config),
352
 
                                                 plaintext, self.rev_id)
353
 
        self.branch.revision_store.add(rev_tmp, self.rev_id)
 
352
            self.branch.repository.store_revision_signature(
 
353
                gpg.GPGStrategy(self.config), plaintext, self.rev_id)
 
354
        self.branch.repository.revision_store.add(rev_tmp, self.rev_id)
354
355
        mutter('new revision_id is {%s}', self.rev_id)
355
356
 
356
357
    def _remove_deleted(self):