The Branch API in bzrlib provides creation and management of Branches.

A Branch represents a series of commits and merges carried out by a user.

Make a p        return _mod_revision.NULL_REVISION

    def _change_last_revision(self, revision_id):
        """See WorkingTree._change_last_revision."""
        if revision_id is None or revision_id == _mod_revision.NULL_REVISION:
            try:
                self._transport.delete('last-revision')
            except errors.NoSuchFile:
                pass
            return False
        else:
            self._transport.put_bytes('last-revision', revision_id,
                mode=self.bzrdir._get_file_mode())
            return True

    def _get_check_refs(self):
        """Return the references needed to perform a check of this tree."""
        return [('trees', self.last_revision())]

    def unlock(self):
        if self._control_files._lock_count == 1:
           # do non-implementation specific cleanup
            sel