/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_mv.py

  • Committer: Marius Kruger
  • Date: 2007-01-19 19:23:53 UTC
  • mto: This revision was merged to the branch mainline in revision 2241.
  • Revision ID: amanic@gmail.com-20070119192353-i96mfa4bsya9thdu
* Fix errors.py import order
* Atemt to handle exceptions better in WorkingTree._move

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
        is handled correctly by bzr mv.
166
166
        Setup: a is in the working tree, b does not exist.
167
167
        User does: mv a b; bzr mv a b
168
 
 
169
168
        """
170
169
        self.build_tree(['a'])
171
170
        tree = self.make_branch_and_tree('.')
182
181
        to another versiond file will fail.
183
182
        Setup: a and b are in the working tree.
184
183
        User does: rm b; mv a b; bzr mv a b
185
 
 
186
184
        """
187
185
        self.build_tree(['a', 'b'])
188
186
        tree = self.make_branch_and_tree('.')
204
202
        directory by an external tool, is handled correctly by bzr mv.
205
203
        Setup: a and sub/ are in the working tree.
206
204
        User does: mv a sub/a; bzr mv a sub/a
207
 
 
208
205
        """
209
206
        self.build_tree(['a', 'sub/'])
210
207
        tree = self.make_branch_and_tree('.')
221
218
        into an unversioned directory will fail.
222
219
        Setup: a is in the working tree, sub/ is not.
223
220
        User does: mv a sub/a; bzr mv a sub/a
224
 
 
225
221
        """
226
222
        self.build_tree(['a', 'sub/'])
227
223
        tree = self.make_branch_and_tree('.')
241
237
        directory by an external tool, is handled correctly by bzr mv.
242
238
        Setup: a1, a2, sub are in the working tree.
243
239
        User does: mv a1 sub/.; bzr mv a1 a2 sub
244
 
 
245
240
        """
246
241
        self.build_tree(['a1', 'a2', 'sub/'])
247
242
        tree = self.make_branch_and_tree('.')
259
254
        into an unversioned directory will fail.
260
255
        Setup: a1, a2 are in the working tree, sub is not.
261
256
        User does: mv a1 sub/.; bzr mv a1 a2 sub
262
 
 
263
257
        """
264
258
        self.build_tree(['a1', 'a2', 'sub/'])
265
259
        tree = self.make_branch_and_tree('.')
282
276
        option to force this.
283
277
        Setup: a is in the working tree, b not versioned.
284
278
        User does: mv a b; touch a; bzr mv a b
285
 
 
286
279
        """
287
280
        self.build_tree(['a', 'b'])
288
281
        tree = self.make_branch_and_tree('.')
291
284
        os.rename('a', 'b')
292
285
        self.build_tree(['a']) #touch a
293
286
        self.run_bzr_error(
294
 
            ["^bzr: ERROR: Could not rename a to b because both files exist."
 
287
            ["^bzr: ERROR: Could not rename a => b because both files exist."
295
288
             " \(Use --after to update the Bazaar id\)$"],
296
289
            'mv', 'a', 'b')
297
290
        self.failUnlessExists('a')
307
300
        Setup: a is in the working tree and b exists.
308
301
        User does: mv a b; touch a; bzr mv a b --after
309
302
        Resulting in a => b and a is unknown.
310
 
 
311
303
        """
312
304
        self.build_tree(['a', 'b'])
313
305
        tree = self.make_branch_and_tree('.')
331
323
        Setup: a1, a2, sub are versioned and in the working tree,
332
324
               sub/a1, sub/a2 are in working tree.
333
325
        User does: mv a* sub; touch a1; touch a2; bzr mv a1 a2 sub
334
 
 
335
326
        """
336
327
        self.build_tree(['a1', 'a2', 'sub/', 'sub/a1', 'sub/a2'])
337
328
        tree = self.make_branch_and_tree('.')
342
333
        self.build_tree(['a2']) #touch a2
343
334
 
344
335
        self.run_bzr_error(
345
 
            ["^bzr: ERROR: Could not rename a1 to sub/a1 because both files exist."
 
336
            ["^bzr: ERROR: Could not rename a1 => sub/a1 because both files exist."
346
337
             " \(Use --after to update the Bazaar id\)$"],
347
338
            'mv', 'a1', 'a2', 'sub')
348
339
        self.failUnlessExists('a1')
362
353
        Setup: a1, a2, sub are versioned and in the working tree,
363
354
               sub/a1, sub/a2 are in working tree.
364
355
        User does: mv a* sub; touch a1; touch a2; bzr mv a1 a2 sub --after
365
 
 
366
356
        """
367
357
        self.build_tree(['a1', 'a2', 'sub/', 'sub/a1', 'sub/a2'])
368
358
        tree = self.make_branch_and_tree('.')