~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-19 13:56:32 UTC
  • mto: This revision was merged to the branch mainline in revision 5805.
  • Revision ID: jelmer@samba.org-20110419135632-7r3ag46vdsfw00td
RaiseĀ InvalidRevisionIdĀ onĀ Branch.set_last_revision_info.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2577
2577
        configured to check constraints on history, in which case this may not
2578
2578
        be permitted.
2579
2579
        """
2580
 
        revision_id = _mod_revision.ensure_null(revision_id)
 
2580
        if not revision_id or not isinstance(revision_id, basestring):
 
2581
            raise errors.InvalidRevisionId(revision_id=revision_id, branch=self)
2581
2582
        # this old format stores the full history, but this api doesn't
2582
2583
        # provide it, so we must generate, and might as well check it's
2583
2584
        # correct
2813
2814
 
2814
2815
    @needs_write_lock
2815
2816
    def set_last_revision_info(self, revno, revision_id):
2816
 
        revision_id = _mod_revision.ensure_null(revision_id)
 
2817
        if not revision_id or not isinstance(revision_id, basestring):
 
2818
            raise errors.InvalidRevisionId(revision_id=revision_id, branch=self)
2817
2819
        old_revno, old_revid = self.last_revision_info()
2818
2820
        if self._get_append_revisions_only():
2819
2821
            self._check_history_violation(revision_id)