~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-03 20:18:35 UTC
  • mfrom: (1185.82.137 w-changeset)
  • Revision ID: pqm@pqm.ubuntu.com-20060603201835-1c9a1725641ccd24
Implement bundles

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 by Canonical Ltd
 
1
# Copyright (C) 2005,2006 by Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
 
20
20
import os
21
21
 
22
 
from bzrlib import branch, bzrdir
 
22
import bzrlib.branch
 
23
import bzrlib.bzrdir
23
24
from bzrlib.repository import RepositoryFormatKnit1
24
25
from bzrlib.tests.blackbox import ExternalBase
25
26
from bzrlib.workingtree import WorkingTree
43
44
        self.example_branch()
44
45
        os.chdir('..')
45
46
        self.runbzr('branch a b')
46
 
        b = branch.Branch.open('b')
 
47
        b = bzrlib.branch.Branch.open('b')
47
48
        self.assertEqual('b\n', b.control_files.get_utf8('branch-name').read())
48
49
        self.runbzr('branch a c -r 1')
49
50
        os.chdir('b')
65
66
        self.assertFalse(source.branch.repository.has_revision('2'))
66
67
        dir = source.bzrdir
67
68
        self.runbzr('branch source target --basis commit_tree')
68
 
        target = bzrdir.BzrDir.open('target')
 
69
        target = bzrlib.bzrdir.BzrDir.open('target')
69
70
        self.assertEqual('2', target.open_branch().last_revision())
70
71
        self.assertEqual('2', target.open_workingtree().last_revision())
71
72
        self.assertTrue(target.open_branch().repository.has_revision('2'))
72
73
 
73
74
    def test_branch_only_copies_history(self):
74
75
        # Knit branches should only push the history for the current revision.
75
 
        format = bzrdir.BzrDirMetaFormat1()
 
76
        format = bzrlib.bzrdir.BzrDirMetaFormat1()
76
77
        format.repository_format = RepositoryFormatKnit1()
77
78
        shared_repo = self.make_repository('repo', format=format, shared=True)
78
79
        shared_repo.set_make_working_trees(True)