/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Aaron Bentley
  • Date: 2007-02-13 22:25:26 UTC
  • mto: (2230.3.47 branch6)
  • mto: This revision was merged to the branch mainline in revision 2290.
  • Revision ID: abentley@panoramicfeedback.com-20070213222526-ztxquwl9cax22cbf
Change asserts to specific errors for left-hand history violations

Show diffs side-by-side

added added

removed removed

Lines of Context:
1713
1713
        if len(history) == 0:
1714
1714
            self.set_last_revision('null:')
1715
1715
        else:
1716
 
            assert history == self._lefthand_history(history[-1])
 
1716
            if history != self._lefthand_history(history[-1]):
 
1717
                raise errors.NotLefthandHistory(history)
1717
1718
            self.set_last_revision(history[-1])
1718
1719
        for hook in Branch.hooks['set_rh']:
1719
1720
            hook(self, history)
1725
1726
        prev_revision = self.last_revision()
1726
1727
        for revision in self.repository.get_revisions(revision_ids):
1727
1728
            if prev_revision is None:
1728
 
                assert revision.parent_ids == []
 
1729
                if revision.parent_ids != []:
 
1730
                    raise errors.NotLeftParentDescendant(self, prev_revision,
 
1731
                                                         revision.revision_id)
1729
1732
            else:
1730
 
                assert revision.parent_ids[0] == prev_revision
 
1733
                if revision.parent_ids[0] != prev_revision:
 
1734
                    raise errors.NotLeftParentDescendant(self, prev_revision,
 
1735
                                                         revision.revision_id)
1731
1736
            prev_revision = revision.revision_id
1732
1737
        self.set_last_revision(revision_ids[-1])
1733
1738