bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
2052.3.2
by John Arbash Meinel
Change Copyright .. by Canonical to Copyright ... Canonical |
1 |
# Copyright (C) 2006 Canonical Ltd
|
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
2 |
#
|
3 |
# This program is free software; you can redistribute it and/or modify
|
|
4 |
# it under the terms of the GNU General Public License as published by
|
|
5 |
# the Free Software Foundation; either version 2 of the License, or
|
|
6 |
# (at your option) any later version.
|
|
7 |
#
|
|
8 |
# This program is distributed in the hope that it will be useful,
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
12 |
#
|
|
13 |
# You should have received a copy of the GNU General Public License
|
|
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
|
|
16 |
||
17 |
"""Test for 'bzr mv'"""
|
|
18 |
||
19 |
import os |
|
20 |
||
|
2091.3.6
by Aaron Bentley
Add symlink test guards |
21 |
from bzrlib import ( |
22 |
osutils, |
|
23 |
workingtree, |
|
|
2158.2.1
by v.ladeuil+lp at free
Windows tests cleanup. |
24 |
)
|
|
2220.1.14
by Aaron Bentley
Cleanup formatting and error handling |
25 |
|
|
2158.2.1
by v.ladeuil+lp at free
Windows tests cleanup. |
26 |
from bzrlib.tests import ( |
|
2949.5.1
by Alexander Belchenko
selftest: use SymlinkFeature instead of TestSkipped where appropriate |
27 |
SymlinkFeature, |
|
2158.2.1
by v.ladeuil+lp at free
Windows tests cleanup. |
28 |
TestCaseWithTransport, |
29 |
)
|
|
|
2220.1.14
by Aaron Bentley
Cleanup formatting and error handling |
30 |
|
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
31 |
|
32 |
class TestMove(TestCaseWithTransport): |
|
33 |
||
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
34 |
def assertMoved(self,from_path,to_path): |
35 |
"""Assert that to_path is existing and versioned but from_path not. """ |
|
36 |
self.failIfExists(from_path) |
|
37 |
self.assertNotInWorkingTree(from_path) |
|
38 |
||
39 |
self.failUnlessExists(to_path) |
|
40 |
self.assertInWorkingTree(to_path) |
|
41 |
||
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
42 |
def test_mv_modes(self): |
43 |
"""Test two modes of operation for mv""" |
|
44 |
tree = self.make_branch_and_tree('.') |
|
45 |
files = self.build_tree(['a', 'c', 'subdir/']) |
|
46 |
tree.add(['a', 'c', 'subdir']) |
|
47 |
||
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
48 |
self.run_bzr('mv a b') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
49 |
self.assertMoved('a','b') |
|
1846.1.2
by Wouter van Heyst
test mv more rigorously |
50 |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
51 |
self.run_bzr('mv b subdir') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
52 |
self.assertMoved('b','subdir/b') |
|
1846.1.2
by Wouter van Heyst
test mv more rigorously |
53 |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
54 |
self.run_bzr('mv subdir/b a') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
55 |
self.assertMoved('subdir/b','a') |
|
1846.1.2
by Wouter van Heyst
test mv more rigorously |
56 |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
57 |
self.run_bzr('mv a c subdir') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
58 |
self.assertMoved('a','subdir/a') |
59 |
self.assertMoved('c','subdir/c') |
|
|
1846.1.2
by Wouter van Heyst
test mv more rigorously |
60 |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
61 |
self.run_bzr('mv subdir/a subdir/newa') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
62 |
self.assertMoved('subdir/a','subdir/newa') |
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
63 |
|
64 |
def test_mv_unversioned(self): |
|
65 |
self.build_tree(['unversioned.txt']) |
|
66 |
self.run_bzr_error( |
|
|
2206.1.8
by Marius Kruger
Converted move/rename error messages to show source => target. |
67 |
["^bzr: ERROR: Could not rename unversioned.txt => elsewhere." |
|
2745.3.2
by Daniel Watkins
Updated tests to reflect new error text. |
68 |
" .*unversioned.txt is not versioned\.$"], |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
69 |
'mv unversioned.txt elsewhere') |
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
70 |
|
71 |
def test_mv_nonexisting(self): |
|
72 |
self.run_bzr_error( |
|
|
2206.1.8
by Marius Kruger
Converted move/rename error messages to show source => target. |
73 |
["^bzr: ERROR: Could not rename doesnotexist => somewhereelse." |
|
2745.3.2
by Daniel Watkins
Updated tests to reflect new error text. |
74 |
" .*doesnotexist is not versioned\.$"], |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
75 |
'mv doesnotexist somewhereelse') |
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
76 |
|
77 |
def test_mv_unqualified(self): |
|
78 |
self.run_bzr_error(['^bzr: ERROR: missing file argument$'], 'mv') |
|
|
2220.1.14
by Aaron Bentley
Cleanup formatting and error handling |
79 |
|
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
80 |
def test_mv_invalid(self): |
81 |
tree = self.make_branch_and_tree('.') |
|
82 |
self.build_tree(['test.txt', 'sub1/']) |
|
83 |
tree.add(['test.txt']) |
|
84 |
||
85 |
self.run_bzr_error( |
|
|
2745.3.2
by Daniel Watkins
Updated tests to reflect new error text. |
86 |
["^bzr: ERROR: Could not move to sub1: sub1 is not versioned\.$"], |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
87 |
'mv test.txt sub1') |
|
2206.1.7
by Marius Kruger
* errors |
88 |
|
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
89 |
self.run_bzr_error( |
|
2206.1.9
by Marius Kruger
* Change move/rename errors yet again |
90 |
["^bzr: ERROR: Could not move test.txt => .*hello.txt: " |
|
2745.3.2
by Daniel Watkins
Updated tests to reflect new error text. |
91 |
"sub1 is not versioned\.$"], |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
92 |
'mv test.txt sub1/hello.txt') |
|
2220.1.14
by Aaron Bentley
Cleanup formatting and error handling |
93 |
|
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
94 |
def test_mv_dirs(self): |
95 |
tree = self.make_branch_and_tree('.') |
|
96 |
self.build_tree(['hello.txt', 'sub1/']) |
|
97 |
tree.add(['hello.txt', 'sub1']) |
|
98 |
||
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
99 |
self.run_bzr('mv sub1 sub2') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
100 |
self.assertMoved('sub1','sub2') |
101 |
||
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
102 |
self.run_bzr('mv hello.txt sub2') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
103 |
self.assertMoved('hello.txt','sub2/hello.txt') |
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
104 |
|
105 |
self.build_tree(['sub1/']) |
|
106 |
tree.add(['sub1']) |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
107 |
self.run_bzr('mv sub2/hello.txt sub1') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
108 |
self.assertMoved('sub2/hello.txt','sub1/hello.txt') |
109 |
||
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
110 |
self.run_bzr('mv sub2 sub1') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
111 |
self.assertMoved('sub2','sub1/sub2') |
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
112 |
|
|
1846.1.2
by Wouter van Heyst
test mv more rigorously |
113 |
def test_mv_relative(self): |
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
114 |
self.build_tree(['sub1/', 'sub1/sub2/', 'sub1/hello.txt']) |
115 |
tree = self.make_branch_and_tree('.') |
|
116 |
tree.add(['sub1', 'sub1/sub2', 'sub1/hello.txt']) |
|
117 |
||
118 |
os.chdir('sub1/sub2') |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
119 |
self.run_bzr('mv ../hello.txt .') |
|
1846.1.1
by Wouter van Heyst
Don't fail on 'bzr mv', extract move tests from OldTests. |
120 |
self.failUnlessExists('./hello.txt') |
121 |
||
122 |
os.chdir('..') |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
123 |
self.run_bzr('mv sub2/hello.txt .') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
124 |
os.chdir('..') |
125 |
self.assertMoved('sub1/sub2/hello.txt','sub1/hello.txt') |
|
|
1846.1.2
by Wouter van Heyst
test mv more rigorously |
126 |
|
|
2978.8.2
by Alexander Belchenko
teach fancy_rename to handle change case renames in possible case-insensitive filesystem |
127 |
def test_mv_change_case(self): |
128 |
# test for bug #77740 (mv unable change filename case on Windows)
|
|
|
2978.8.1
by Alexander Belchenko
Rename on Windows is able to change filename case. (#77740) |
129 |
tree = self.make_branch_and_tree('.') |
130 |
self.build_tree(['test.txt']) |
|
131 |
tree.add(['test.txt']) |
|
132 |
self.run_bzr('mv test.txt Test.txt') |
|
|
2978.8.2
by Alexander Belchenko
teach fancy_rename to handle change case renames in possible case-insensitive filesystem |
133 |
# we can't use failUnlessExists on case-insensitive filesystem
|
134 |
# so try to check shape of the tree
|
|
|
2978.8.1
by Alexander Belchenko
Rename on Windows is able to change filename case. (#77740) |
135 |
shape = sorted(os.listdir(u'.')) |
136 |
self.assertEqual(['.bzr', 'Test.txt'], shape) |
|
137 |
self.assertInWorkingTree('Test.txt') |
|
138 |
self.assertNotInWorkingTree('test.txt') |
|
139 |
||
|
1846.1.2
by Wouter van Heyst
test mv more rigorously |
140 |
def test_mv_smoke_aliases(self): |
141 |
# just test that aliases for mv exist, if their behaviour is changed in
|
|
142 |
# the future, then extend the tests.
|
|
143 |
self.build_tree(['a']) |
|
144 |
tree = self.make_branch_and_tree('.') |
|
145 |
tree.add(['a']) |
|
146 |
||
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
147 |
self.run_bzr('move a b') |
148 |
self.run_bzr('rename b a') |
|
|
2091.3.2
by Aaron Bentley
Traverse non-terminal symlinks for mv et al |
149 |
|
150 |
def test_mv_through_symlinks(self): |
|
|
2949.5.1
by Alexander Belchenko
selftest: use SymlinkFeature instead of TestSkipped where appropriate |
151 |
self.requireFeature(SymlinkFeature) |
|
2091.3.2
by Aaron Bentley
Traverse non-terminal symlinks for mv et al |
152 |
tree = self.make_branch_and_tree('.') |
153 |
self.build_tree(['a/', 'a/b']) |
|
154 |
os.symlink('a', 'c') |
|
155 |
os.symlink('.', 'd') |
|
156 |
tree.add(['a', 'a/b', 'c'], ['a-id', 'b-id', 'c-id']) |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
157 |
self.run_bzr('mv c/b b') |
|
2091.3.2
by Aaron Bentley
Traverse non-terminal symlinks for mv et al |
158 |
tree = workingtree.WorkingTree.open('.') |
159 |
self.assertEqual('b-id', tree.path2id('b')) |
|
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
160 |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
161 |
def test_mv_already_moved_file(self): |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
162 |
"""Test bzr mv original_file to moved_file. |
163 |
||
164 |
Tests if a file which has allready been moved by an external tool,
|
|
165 |
is handled correctly by bzr mv.
|
|
166 |
Setup: a is in the working tree, b does not exist.
|
|
167 |
User does: mv a b; bzr mv a b
|
|
168 |
"""
|
|
169 |
self.build_tree(['a']) |
|
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
170 |
tree = self.make_branch_and_tree('.') |
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
171 |
tree.add(['a']) |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
172 |
|
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
173 |
osutils.rename('a', 'b') |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
174 |
self.run_bzr('mv a b') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
175 |
self.assertMoved('a','b') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
176 |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
177 |
def test_mv_already_moved_file_to_versioned_target(self): |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
178 |
"""Test bzr mv existing_file to versioned_file. |
179 |
||
180 |
Tests if an attempt to move an existing versioned file
|
|
181 |
to another versiond file will fail.
|
|
182 |
Setup: a and b are in the working tree.
|
|
183 |
User does: rm b; mv a b; bzr mv a b
|
|
184 |
"""
|
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
185 |
self.build_tree(['a', 'b']) |
186 |
tree = self.make_branch_and_tree('.') |
|
187 |
tree.add(['a', 'b']) |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
188 |
|
189 |
os.remove('b') |
|
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
190 |
osutils.rename('a', 'b') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
191 |
self.run_bzr_error( |
|
2745.3.2
by Daniel Watkins
Updated tests to reflect new error text. |
192 |
["^bzr: ERROR: Could not move a => b. b is already versioned\.$"], |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
193 |
'mv a b') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
194 |
#check that nothing changed
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
195 |
self.failIfExists('a') |
196 |
self.failUnlessExists('b') |
|
197 |
||
198 |
def test_mv_already_moved_file_into_subdir(self): |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
199 |
"""Test bzr mv original_file to versioned_directory/file. |
200 |
||
201 |
Tests if a file which has already been moved into a versioned
|
|
202 |
directory by an external tool, is handled correctly by bzr mv.
|
|
203 |
Setup: a and sub/ are in the working tree.
|
|
204 |
User does: mv a sub/a; bzr mv a sub/a
|
|
205 |
"""
|
|
206 |
self.build_tree(['a', 'sub/']) |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
207 |
tree = self.make_branch_and_tree('.') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
208 |
tree.add(['a', 'sub']) |
209 |
||
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
210 |
osutils.rename('a', 'sub/a') |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
211 |
self.run_bzr('mv a sub/a') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
212 |
self.assertMoved('a','sub/a') |
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
213 |
|
214 |
def test_mv_already_moved_file_into_unversioned_subdir(self): |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
215 |
"""Test bzr mv original_file to unversioned_directory/file. |
216 |
||
217 |
Tests if an attempt to move an existing versioned file
|
|
218 |
into an unversioned directory will fail.
|
|
219 |
Setup: a is in the working tree, sub/ is not.
|
|
220 |
User does: mv a sub/a; bzr mv a sub/a
|
|
221 |
"""
|
|
222 |
self.build_tree(['a', 'sub/']) |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
223 |
tree = self.make_branch_and_tree('.') |
224 |
tree.add(['a']) |
|
225 |
||
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
226 |
osutils.rename('a', 'sub/a') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
227 |
self.run_bzr_error( |
|
2745.3.2
by Daniel Watkins
Updated tests to reflect new error text. |
228 |
["^bzr: ERROR: Could not move a => a: sub is not versioned\.$"], |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
229 |
'mv a sub/a') |
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
230 |
self.failIfExists('a') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
231 |
self.failUnlessExists('sub/a') |
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
232 |
|
233 |
def test_mv_already_moved_files_into_subdir(self): |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
234 |
"""Test bzr mv original_files to versioned_directory. |
235 |
||
236 |
Tests if files which has already been moved into a versioned
|
|
237 |
directory by an external tool, is handled correctly by bzr mv.
|
|
238 |
Setup: a1, a2, sub are in the working tree.
|
|
239 |
User does: mv a1 sub/.; bzr mv a1 a2 sub
|
|
240 |
"""
|
|
241 |
self.build_tree(['a1', 'a2', 'sub/']) |
|
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
242 |
tree = self.make_branch_and_tree('.') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
243 |
tree.add(['a1', 'a2', 'sub']) |
244 |
||
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
245 |
osutils.rename('a1', 'sub/a1') |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
246 |
self.run_bzr('mv a1 a2 sub') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
247 |
self.assertMoved('a1','sub/a1') |
248 |
self.assertMoved('a2','sub/a2') |
|
249 |
||
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
250 |
def test_mv_already_moved_files_into_unversioned_subdir(self): |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
251 |
"""Test bzr mv original_file to unversioned_directory. |
252 |
||
253 |
Tests if an attempt to move existing versioned file
|
|
254 |
into an unversioned directory will fail.
|
|
255 |
Setup: a1, a2 are in the working tree, sub is not.
|
|
256 |
User does: mv a1 sub/.; bzr mv a1 a2 sub
|
|
257 |
"""
|
|
258 |
self.build_tree(['a1', 'a2', 'sub/']) |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
259 |
tree = self.make_branch_and_tree('.') |
260 |
tree.add(['a1', 'a2']) |
|
261 |
||
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
262 |
osutils.rename('a1', 'sub/a1') |
|
2206.1.8
by Marius Kruger
Converted move/rename error messages to show source => target. |
263 |
self.run_bzr_error( |
|
2745.3.2
by Daniel Watkins
Updated tests to reflect new error text. |
264 |
["^bzr: ERROR: Could not move to sub. sub is not versioned\.$"], |
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
265 |
'mv a1 a2 sub') |
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
266 |
self.failIfExists('a1') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
267 |
self.failUnlessExists('sub/a1') |
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
268 |
self.failUnlessExists('a2') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
269 |
self.failIfExists('sub/a2') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
270 |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
271 |
def test_mv_already_moved_file_forcing_after(self): |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
272 |
"""Test bzr mv versioned_file to unversioned_file. |
273 |
||
274 |
Tests if an attempt to move an existing versioned file to an existing
|
|
275 |
unversioned file will fail, informing the user to use the --after
|
|
276 |
option to force this.
|
|
277 |
Setup: a is in the working tree, b not versioned.
|
|
278 |
User does: mv a b; touch a; bzr mv a b
|
|
279 |
"""
|
|
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
280 |
self.build_tree(['a', 'b']) |
281 |
tree = self.make_branch_and_tree('.') |
|
282 |
tree.add(['a']) |
|
283 |
||
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
284 |
osutils.rename('a', 'b') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
285 |
self.build_tree(['a']) #touch a |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
286 |
self.run_bzr_error( |
|
2220.1.12
by Marius Kruger
* Fix errors.py import order |
287 |
["^bzr: ERROR: Could not rename a => b because both files exist." |
|
2967.3.2
by Daniel Watkins
Modified tests to reflect modified error messages. |
288 |
" \(Use --after to tell bzr about a rename that has already"
|
289 |
" happened\)$"], |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
290 |
'mv a b') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
291 |
self.failUnlessExists('a') |
292 |
self.failUnlessExists('b') |
|
293 |
||
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
294 |
def test_mv_already_moved_file_using_after(self): |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
295 |
"""Test bzr mv --after versioned_file to unversioned_file. |
296 |
||
297 |
Tests if an existing versioned file can be forced to move to an
|
|
298 |
existing unversioned file using the --after option. With the result
|
|
299 |
that bazaar considers the unversioned_file to be moved from
|
|
300 |
versioned_file and versioned_file will become unversioned.
|
|
301 |
Setup: a is in the working tree and b exists.
|
|
302 |
User does: mv a b; touch a; bzr mv a b --after
|
|
303 |
Resulting in a => b and a is unknown.
|
|
304 |
"""
|
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
305 |
self.build_tree(['a', 'b']) |
306 |
tree = self.make_branch_and_tree('.') |
|
307 |
tree.add(['a']) |
|
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
308 |
osutils.rename('a', 'b') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
309 |
self.build_tree(['a']) #touch a |
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
310 |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
311 |
self.run_bzr('mv a b --after') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
312 |
self.failUnlessExists('a') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
313 |
self.assertNotInWorkingTree('a')#a should be unknown now. |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
314 |
self.failUnlessExists('b') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
315 |
self.assertInWorkingTree('b') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
316 |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
317 |
def test_mv_already_moved_files_forcing_after(self): |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
318 |
"""Test bzr mv versioned_files to directory/unversioned_file. |
319 |
||
320 |
Tests if an attempt to move an existing versioned file to an existing
|
|
321 |
unversioned file in some other directory will fail, informing the user
|
|
322 |
to use the --after option to force this.
|
|
323 |
||
324 |
Setup: a1, a2, sub are versioned and in the working tree,
|
|
325 |
sub/a1, sub/a2 are in working tree.
|
|
326 |
User does: mv a* sub; touch a1; touch a2; bzr mv a1 a2 sub
|
|
327 |
"""
|
|
328 |
self.build_tree(['a1', 'a2', 'sub/', 'sub/a1', 'sub/a2']) |
|
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
329 |
tree = self.make_branch_and_tree('.') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
330 |
tree.add(['a1', 'a2', 'sub']) |
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
331 |
osutils.rename('a1', 'sub/a1') |
332 |
osutils.rename('a2', 'sub/a2') |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
333 |
self.build_tree(['a1']) #touch a1 |
334 |
self.build_tree(['a2']) #touch a2 |
|
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
335 |
|
336 |
self.run_bzr_error( |
|
|
2967.3.2
by Daniel Watkins
Modified tests to reflect modified error messages. |
337 |
["^bzr: ERROR: Could not rename a1 => sub/a1 because both files" |
338 |
" exist. \(Use --after to tell bzr about a rename that has already"
|
|
339 |
" happened\)$"], |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
340 |
'mv a1 a2 sub') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
341 |
self.failUnlessExists('a1') |
342 |
self.failUnlessExists('a2') |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
343 |
self.failUnlessExists('sub/a1') |
344 |
self.failUnlessExists('sub/a2') |
|
345 |
||
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
346 |
def test_mv_already_moved_files_using_after(self): |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
347 |
"""Test bzr mv --after versioned_file to directory/unversioned_file. |
348 |
||
349 |
Tests if an existing versioned file can be forced to move to an
|
|
350 |
existing unversioned file in some other directory using the --after
|
|
351 |
option. With the result that bazaar considers
|
|
352 |
directory/unversioned_file to be moved from versioned_file and
|
|
353 |
versioned_file will become unversioned.
|
|
354 |
||
355 |
Setup: a1, a2, sub are versioned and in the working tree,
|
|
356 |
sub/a1, sub/a2 are in working tree.
|
|
357 |
User does: mv a* sub; touch a1; touch a2; bzr mv a1 a2 sub --after
|
|
358 |
"""
|
|
359 |
self.build_tree(['a1', 'a2', 'sub/', 'sub/a1', 'sub/a2']) |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
360 |
tree = self.make_branch_and_tree('.') |
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
361 |
tree.add(['a1', 'a2', 'sub']) |
|
2309.2.3
by Alexander Belchenko
blackbox.test_mv: using safe osutils.rename instead of os.rename |
362 |
osutils.rename('a1', 'sub/a1') |
363 |
osutils.rename('a2', 'sub/a2') |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
364 |
self.build_tree(['a1']) #touch a1 |
365 |
self.build_tree(['a2']) #touch a2 |
|
|
2123.3.7
by Steffen Eichenberg
split tests so that each new method contains one test only |
366 |
|
|
2552.2.3
by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests. |
367 |
self.run_bzr('mv a1 a2 sub --after') |
|
2123.3.4
by Steffen Eichenberg
a few new blackbox test for mv |
368 |
self.failUnlessExists('a1') |
369 |
self.failUnlessExists('a2') |
|
|
2220.1.5
by Marius Kruger
* bzrlib/tests/blackbox/test_mv.py |
370 |
self.failUnlessExists('sub/a1') |
371 |
self.failUnlessExists('sub/a2') |
|
372 |
self.assertInWorkingTree('sub/a1') |
|
|
2220.1.14
by Aaron Bentley
Cleanup formatting and error handling |
373 |
self.assertInWorkingTree('sub/a2') |