00000008
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ã653_‘I|¥‰ÓMdœv ©ƒ†ü+=ÃÂ �    ‹      Õ—]o›0†ï÷+<_ì.œ|®_„©•­M£–i›¦	Ûk#ÛiÚýú9�¶´%Ýª!¤^Çoçñ‰_c÷­>	¾ÏOÐ§àìÍ¿|<�Nî |L üÀ/†N·p2Ã'Æä‡ ëõÚY©b. 1ËtÚ(A�ÃÃÞwóÞ 7á„Ù+r�0)÷¦ã×H.È•Ñ‚ñ!äJRÐ<]€’ÒÀJ+MWŒC$¥6�Ê´\)ÊµE›ÊÌn$ÙÍæ…½ÿOnslK%Ñö›[å¹&AW$q6ÆFæØsÅ2FZÑ1Ae¦!JIöË‰Å#’š1þ1�œÿ´:0Éæ×žKP¢øbŒ?LÆ³£ó±�½YrH½æÌjŽ±wJ´AKÉÄBp¶S|Yˆ/ÅïÝ	ýBãsM•È��Ù½,b•ÊTçÄ²Ž,A¢ªªBÂþ6„>˜ŒùñÅÉ,ð§Å”°MŠûê^Ø*ìÍ‰â™A¾Pœ©nJ’"í»,ÒùÑí#*ëT"Nöê Zåà¿6U¸à[P‹-hh+Ž¹r’Ü¦z©Öý¨Ð~·?ètG�Þêö‡í"ê¿ÿÜMH–ñ4\pbVŠP5Á&¸öœQë\Õ^=�5Aµït[£â×”ozhQXÊÕÃ¾=;üÚ:X–®´êS$g¿5’8•¹ýÛ…ÚÚ‰ËŽíj¦[íùHu�5»¾úÎ^kvó‘Š…v[Rœ,š§±F<¾wÐ•æW\	sÖ™â3ƒÍ¸c{Žq‡òÀë¢Ít°=ß¿c¨íÜëÝÏŒ½&²8´Ä<-½¾.ÚÙèY²üX†òáÂö„âBq$úbü}Nu       ˆÀ¿Ä525¾ÃÂ     ‹      Õ•QoÚ0Çßû)<?ì.¡hÔñÔ¤¡Q@”iš¦irbC¬&6²”}ú9$V•­Ó6­{òùò÷Ýý.‰�<‹Ç½Ù‡I½™]ÑäÝëá ‡pàýy žÅÕƒ‹fôGáÌ¹e`³Ù47çMm0›BæŠü¬32uMî8¦g¤ôÑ3D2Á¸_qÒå‚wHÏè•³’nk�‹µL…-m'
(D¡Í¶^:Pš‹ Þ†aì*©”ª°>Ô™H¢ù¶, üóÉ|Ì
Kv9KÓPâ2´f¹\¨;½Ä”Èb�¬I#2ÕÊB’3uÛ\È9F,wþ8è�?y¸¬<M	C™ó¿êE£Ëqc:b… ÀÖ\{Í¦Cf*4—s)øIñM%¾‘_NŒ+M,ljäÒI­RðˆÇ¨©Îí’yÖž 3ÇªJÂÖ–~×ŒÉÕ´?šÅƒiÕ^†8T÷[¯Ó	3B9K#Rç½5W•ä¹Jìòr¿EuÕF.2‡)Bô òPç:çÂÃžÂÜƒaº·Ž+½WZ+hµaØ_¢°ÓÚ=#×Âìjë©0¬Ô­Òuá¿èA|f+ÊèD|£9¸�Õ
QÐî¶‚“XþN}û°î!ý¯8+±ö¿5¦Õú÷yÿA=ì†�j
~†N;xh    B   	ˆl–Ü4ý( ©”u( 	•íÀà™S�ÿ�þ\h’¬Ü¢#á�a	HçÆ„oßÅ_ŠI|¥�+Wé3ž¯ÅÄ ?÷     	# Copyright (C) 2006-2007 by Jelmer Vernooij
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""Tests for the rebase code."""

from ....conflicts import ConflictList
from ....errors import (
    UnknownFormatError,
    ConflictsInTree,
    )
from ....graph import (
    Graph,
    DictParentsProvider,
    )
from ....revision import NULL_REVISION
from ....tests import TestCase, TestCaseWithTransport
from ....tests.matchers import RevisionHistoryMatches
from ....transport import (
    NoSuchFile,
    )

from ..rebase import (
    marshall_rebase_plan,
    unmarshall_rebase_plan,
    CommitBuilderRevisionRewriter,
    generate_simple_plan,
    generate_transpose_plan,
    rebase_todo,
    REBASE_PLAN_FILENAME,
    REBASE_CURRENT_REVID_FILENAME,
    RebaseState1,
    ReplaySnapshotError,
    WorkingTreeRevisionRewriter,
    )


class RebasePlanReadWriterTests(TestCase):

    def test_simple_marshall_rebase_plan(self):
        self.assertEqualDiff(b"""\
# Bazaar rebase plan 1
1 bla
oldrev newrev newparent1 newparent2
""", marshall_rebase_plan((1, b"bla"),
                          {b"oldrev": (b"newrev", (b"newparent1", b"newparent2"))}))

    def test_simple_unmarshall_rebase_plan(self):
        self.assertEqual(((1, b"bla"),
                          {b"oldrev": (b"newrev", (b"newparent1", b"newparent2"))}),
                          unmarshall_rebase_plan(b"""# Bazaar rebase plan 1
1 bla
oldrev newrev newparent1 newparent2
"""))

    def test_unmarshall_rebase_plan_formatunknown(self):
        self.assertRaises(UnknownFormatError,
                          unmarshall_rebase_plan, b"""# Bazaar rebase plan x
1 bla
oldrev newrev newparent1 newparent2
""")


class ConversionTests(TestCaseWithTransport):

    def test_simple(self):
        wt = self.make_branch_and_tree('.')
        b = wt.branch
        with open('hello', 'w') as f:
            f.write('hello world')
        wt.add('hello')
        wt.commit(message='add hello', rev_id=b"bla")
        with open('hello', 'w') as f:
            f.write('world')
        wt.commit(message='change he