/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 breezy/tests/test_fetch_ghosts.py

  • Committer: Jelmer Vernooij
  • Date: 2020-03-22 01:35:14 UTC
  • mfrom: (7490.7.6 work)
  • mto: This revision was merged to the branch mainline in revision 7499.
  • Revision ID: jelmer@jelmer.uk-20200322013514-7vw1ntwho04rcuj3
merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
from ..fetch_ghosts import GhostFetcher
20
18
from . import TestCaseWithTransport
21
19
 
24
22
 
25
23
    def prepare_with_ghosts(self):
26
24
        tree = self.make_branch_and_tree('.')
27
 
        tree.commit('rev1', rev_id='rev1-id')
28
 
        tree.set_parent_ids(['rev1-id', 'ghost-id'])
 
25
        tree.commit('rev1', rev_id=b'rev1-id')
 
26
        tree.set_parent_ids([b'rev1-id', b'ghost-id'])
29
27
        tree.commit('rev2')
30
28
        return tree
31
29
 
33
31
        tree = self.prepare_with_ghosts()
34
32
        branch = self.make_branch('branch')
35
33
        GhostFetcher(tree.branch, branch).run()
36
 
        self.assertFalse(tree.branch.repository.has_revision('ghost-id'))
 
34
        self.assertFalse(tree.branch.repository.has_revision(b'ghost-id'))
37
35
 
38
36
    def test_fetch_ghosts_success(self):
39
37
        tree = self.prepare_with_ghosts()
40
38
        ghost_tree = self.make_branch_and_tree('ghost_tree')
41
 
        ghost_tree.commit('ghost', rev_id='ghost-id')
 
39
        ghost_tree.commit('ghost', rev_id=b'ghost-id')
42
40
        GhostFetcher(tree.branch, ghost_tree.branch).run()
43
 
        self.assertTrue(tree.branch.repository.has_revision('ghost-id'))
 
41
        self.assertTrue(tree.branch.repository.has_revision(b'ghost-id'))