~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-13 18:52:58 UTC
  • mfrom: (5222.1.1 no-rootless-commits)
  • Revision ID: pqm@pqm.ubuntu.com-20100513185258-xtx26u4bsjyhat1n
(abentley) CommitBuilder refuses to commit trees with no root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
 
289
289
        :param tree: The tree which is being committed.
290
290
        """
291
 
        # NB: if there are no parents then this method is not called, so no
292
 
        # need to guard on parents having length.
 
291
        if len(self.parents) == 0:
 
292
            raise errors.RootMissing()
293
293
        entry = entry_factory['directory'](tree.path2id(''), '',
294
294
            None)
295
295
        entry.revision = self._new_revision_id
1045
1045
                " id and insertion revid (%r, %r)"
1046
1046
                % (inv.revision_id, revision_id))
1047
1047
        if inv.root is None:
1048
 
            raise AssertionError()
 
1048
            raise errors.RootMissing()
1049
1049
        return self._add_inventory_checked(revision_id, inv, parents)
1050
1050
 
1051
1051
    def _add_inventory_checked(self, revision_id, inv, parents):