1843200
  5   ˆl–Ðz¾”d
i?u8 \¸Ó× 1hß�þB gÁ”¬”ÏÄƒh¹ÃÂÁ      MAJOR=7
MINOR=2
DEVNAME=loop2
DEVTYPE=disk
DISKSEQ=7
  /   	ˆ{‹„„-i[D<†ªoZƒ›Ù«Å546_‘I|¥‰ÓMdœv ©ƒ†ü+=ÅÄ "    	‹      ½UÑnÚ0}ïWx~Ø[r	Ðv¢Ž§ŽTD™¦iÚƒ‰b5‰#Û�±¯Ÿ! ²	ÖV£{É½qN|Ï9¾º&o¢qöur‡>Îî‡hòùÃpÐGØøÒéD³¨þÐõ[ÀÝ#œZ[ö ªªò«Ž¯ôfSHmžuÁX-cësË1½ ›5z�H*w+m&è àâR	µ´FrÑÞ'ÀUnÀˆ‚'2>¹òSãÇJ•® W±ñŒÉöhWnm€‹Ä)ÓÐí-0Ë¹[´"k×—ïÔ%	Ø± sÅ×rÁÿ%âêm-`ó-ŸMª)±)Z±L.Š[UbJd¾@FÇ!«ÂÀ<cÅ£¿�	F,³!þ6è�¿;Øtó7%¥Z$!~ßG7ã0ÂtÄrA€ÇÜ;Ì-¦Cf,Ê—‰ü$ø¡?ÈŸ§7ŒjL$L¬ei¥*Pp›Rc•™’9­—NAª›¨ÂŸrƒÅ¿™1¹�Þ�fÑ`Z[Â7[Ø½ê±b:aZER‹Ø*½Þé®I¼-æ¦¼Ù¿¢�*-©Å!E¾ÀŠeñX¨ªhºáœ>êƒ“€©{4	þÁ¨Ýj_yAÛk¨Ýéµ®:tsàÓ¿ROTÆ…n2?u‚¥ª„vV×ñüÏaýóù7Ûå�?©#ð:-\÷º×¯ªã-´+×ë˜ÖñþÞHÏ°§¶S�@}åüqÁÌÕ    A   ˆl–Ü4ý( ©”u( 	•íÀà™S�ÿ�þBû Y¹DGÃ Â�ÏÈƒq°‹Ç_ŠI|¥�+Wé3ž¯ÇÆ p    # Copyright (C) 2006-2012 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

"""Full history branch formats."""

from .. import (
    debug,
    errors,
    revision as _mod_revision,
    )

from ..branch import (
    Branch,
    )
from .branch import (
    BzrBranch,
    BranchFormatMetadir,
    )

from ..trace import mutter_callsite


class FullHistoryBzrBranch(BzrBranch):
    """Bzr branch which contains the full revision history."""

    def set_last_revision_info(self, revno, revision_id):
        if not revision_id or not isinstance(revision_id, bytes):
            raise errors.InvalidRevisionId(
                revision_id=revision_id, branch=self)
        with self.lock_write():
            # this old format stores the full history, but this api doesn't
            # provide it, so we must generate, and might as well check it's
            # correct
            history = self._lefthand_history(revision_id)
            if len(history) != revno:
                raise AssertionError('%d != %d' % (len(history), revno))
            self._set_revision_history(history)

    def _read_last_revision_info(self):
        rh = self._revision_history()
        revno = len(rh)
        if revno:
            return (revno, rh[-1])
        else:
            return (0, _mod_revision.NULL_REVISION)

    def _set_revision_history(self, rev_history):
        if 'evil' in debug.debug_flags:
            mutter_callsite(3, "set_revision_history scales with history.")
        check_not_reserved_id = _mod_revision.check_not_reserved_id
        for rev_id in rev_history:
            check_not_reserved_id(rev_id)
        if Branch.hooks['post_change_branch_tip']:
            # Don't calculate the last_revision_info() if there are no hooks
            # that will use it.
            old_revno, old_revid = self.last_revision_info()
        if len(rev_history) == 0:
            revid = _mod_revision.NULL_REVISION
        else:
            revid = rev_history[-1]
        self._run_pre_change_branch_tip_hooks(len(rev_history), revid)
        self._write_revision_history(rev_history)
        self._clear_cached_state()
        self._cache_revision_history(rev_history)
        if Branch.hooks['post_change_branch_tip']:
            self._run_post_change_branch_tip_hooks(old_revno, old_revid)

    def _write_revision_history(self, history):
        """Factored out of set_revision_history.

        This performs the actual writing to disk.
        It is intended to be called by set_revision_history."""
        self._transport.put_bytes(
            'revision-history', b'\n'.join(histor