/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 bzrlib/tests/blackbox/test_remove_tree.py

  • Committer: Martin von Gagern
  • Date: 2010-04-20 08:47:38 UTC
  • mfrom: (5167 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5195.
  • Revision ID: martin.vgagern@gmx.net-20100420084738-ygymnqmdllzrhpfn
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
"""Black-box tests for bzr remove-tree."""
38
38
        os.chdir('branch1')
39
39
        self.run_bzr('remove-tree')
40
40
        self.failIfExists('foo')
41
 
    
 
41
 
42
42
    def test_remove_tree_original_branch_explicit(self):
43
43
        self.run_bzr('remove-tree branch1')
44
44
        self.failIfExists('branch1/foo')
45
45
 
 
46
    def test_remove_tree_multiple_branch_explicit(self):
 
47
        self.tree.bzrdir.sprout('branch2')
 
48
        self.run_bzr('remove-tree branch1 branch2')
 
49
        self.failIfExists('branch1/foo')
 
50
        self.failIfExists('branch2/foo')
 
51
 
46
52
    def test_remove_tree_sprouted_branch(self):
47
53
        self.tree.bzrdir.sprout('branch2')
48
54
        self.failUnlessExists('branch2/foo')
49
55
        os.chdir('branch2')
50
56
        self.run_bzr('remove-tree')
51
57
        self.failIfExists('foo')
52
 
    
 
58
 
53
59
    def test_remove_tree_sprouted_branch_explicit(self):
54
60
        self.tree.bzrdir.sprout('branch2')
55
61
        self.failUnlessExists('branch2/foo')
64
70
        self.failIfExists('foo')
65
71
        os.chdir('..')
66
72
        self.failUnlessExists('branch1/foo')
67
 
    
 
73
 
68
74
    def test_remove_tree_checkout_explicit(self):
69
75
        self.tree.branch.create_checkout('branch2', lightweight=False)
70
76
        self.failUnlessExists('branch2/foo')
84
90
        self.failUnlessExists('foo')
85
91
        os.chdir('..')
86
92
        self.failUnlessExists('branch1/foo')
87
 
    
 
93
 
88
94
    def test_remove_tree_lightweight_checkout_explicit(self):
89
95
        self.tree.branch.create_checkout('branch2', lightweight=True)
90
96
        self.failUnlessExists('branch2/foo')
122
128
        self.run_bzr('remove-tree branch1 --force')
123
129
        self.failIfExists('branch1/foo')
124
130
        self.failUnlessExists('branch1/bar')
 
131
 
 
132
    def test_remove_tree_pending_merges(self):
 
133
        self.run_bzr(['branch', 'branch1', 'branch2'])
 
134
        self.build_tree(['branch1/bar'])
 
135
        self.tree.add('bar')
 
136
        self.tree.commit('2')
 
137
        self.failUnlessExists('branch1/bar')
 
138
        self.run_bzr(['merge', '../branch1'], working_dir='branch2')
 
139
        self.failUnlessExists('branch2/bar')
 
140
        self.run_bzr(['revert', '.'], working_dir='branch2')
 
141
        self.failIfExists('branch2/bar')
 
142
        output = self.run_bzr_error(["Working tree .* has uncommitted changes"],
 
143
                                    'remove-tree branch2', retcode=3)
 
144
 
 
145
    def test_remove_tree_pending_merges_force(self):
 
146
        self.run_bzr(['branch', 'branch1', 'branch2'])
 
147
        self.build_tree(['branch1/bar'])
 
148
        self.tree.add('bar')
 
149
        self.tree.commit('2')
 
150
        self.failUnlessExists('branch1/bar')
 
151
        self.run_bzr(['merge', '../branch1'], working_dir='branch2')
 
152
        self.failUnlessExists('branch2/bar')
 
153
        self.run_bzr(['revert', '.'], working_dir='branch2')
 
154
        self.failIfExists('branch2/bar')
 
155
        self.run_bzr('remove-tree branch2 --force')
 
156
        self.failIfExists('branch2/foo')
 
157
        self.failIfExists('branch2/bar')