~lifeless/bzr/index.range_map

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2008-06-19 01:17:19 UTC
  • mfrom: (3218.1.277 +trunk)
  • Revision ID: robertc@robertcollins.net-20080619011719-1c4g4uxzzhdls2wf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008 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
22
22
from bzrlib import branch, bzrdir
23
23
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
24
24
from bzrlib.tests.blackbox import ExternalBase
 
25
from bzrlib.tests import HardlinkFeature
25
26
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
26
27
from bzrlib.workingtree import WorkingTree
27
28
 
42
43
        self.example_branch('a')
43
44
        self.run_bzr('branch a b')
44
45
        b = branch.Branch.open('b')
45
 
        self.assertEqual('b\n', b.control_files.get_utf8('branch-name').read())
46
46
        self.run_bzr('branch a c -r 1')
 
47
        # previously was erroneously created by branching
 
48
        self.assertFalse(b._transport.has('branch-name'))
47
49
        b.bzrdir.open_workingtree().commit(message='foo', allow_pointless=True)
48
50
 
49
51
    def test_branch_only_copies_history(self):
84
86
        self.assertFalse(pushed_repo.has_revision('a-2'))
85
87
        self.assertTrue(pushed_repo.has_revision('b-1'))
86
88
 
 
89
    def test_branch_hardlink(self):
 
90
        self.requireFeature(HardlinkFeature)
 
91
        source = self.make_branch_and_tree('source')
 
92
        self.build_tree(['source/file1'])
 
93
        source.add('file1')
 
94
        source.commit('added file')
 
95
        self.run_bzr(['branch', 'source', 'target', '--hardlink'])
 
96
        source_stat = os.stat('source/file1')
 
97
        target_stat = os.stat('target/file1')
 
98
        self.assertEqual(source_stat, target_stat)
 
99
 
87
100
 
88
101
class TestRemoteBranch(TestCaseWithSFTPServer):
89
102