/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 brzlib/tests/blackbox/test_mv.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 12:41:27 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521124127-iv8etg0vwymyai6y
s/bzr/brz/ in apport config.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Test for 'brz mv'"""
 
17
"""Test for 'bzr mv'"""
18
18
 
19
19
import os
20
20
 
21
 
import breezy.branch
22
 
from breezy import (
 
21
import brzlib.branch
 
22
from brzlib import (
23
23
    osutils,
24
24
    workingtree,
25
25
    )
26
26
 
27
 
from breezy.tests import (
 
27
from brzlib.tests import (
28
28
    TestCaseWithTransport,
29
 
    script,
30
29
    )
31
 
from breezy.tests.features import (
 
30
from brzlib.tests.features import (
32
31
    CaseInsensitiveFilesystemFeature,
33
32
    SymlinkFeature,
34
33
    UnicodeFilenameFeature,
37
36
 
38
37
class TestMove(TestCaseWithTransport):
39
38
 
40
 
    def assertMoved(self, from_path, to_path):
 
39
    def assertMoved(self,from_path,to_path):
41
40
        """Assert that to_path is existing and versioned but from_path not. """
42
41
        self.assertPathDoesNotExist(from_path)
43
42
        self.assertNotInWorkingTree(from_path)
52
51
        tree.add(['a', 'c', 'subdir'])
53
52
 
54
53
        self.run_bzr('mv a b')
55
 
        self.assertMoved('a', 'b')
 
54
        self.assertMoved('a','b')
56
55
 
57
56
        self.run_bzr('mv b subdir')
58
 
        self.assertMoved('b', 'subdir/b')
 
57
        self.assertMoved('b','subdir/b')
59
58
 
60
59
        self.run_bzr('mv subdir/b a')
61
 
        self.assertMoved('subdir/b', 'a')
 
60
        self.assertMoved('subdir/b','a')
62
61
 
63
62
        self.run_bzr('mv a c subdir')
64
 
        self.assertMoved('a', 'subdir/a')
65
 
        self.assertMoved('c', 'subdir/c')
 
63
        self.assertMoved('a','subdir/a')
 
64
        self.assertMoved('c','subdir/c')
66
65
 
67
66
        self.run_bzr('mv subdir/a subdir/newa')
68
 
        self.assertMoved('subdir/a', 'subdir/newa')
 
67
        self.assertMoved('subdir/a','subdir/newa')
69
68
 
70
69
    def test_mv_unversioned(self):
71
70
        self.build_tree(['unversioned.txt'])
72
71
        self.run_bzr_error(
73
 
            ["^brz: ERROR: Could not rename unversioned.txt => elsewhere."
74
 
             " .*unversioned.txt is not versioned\\.$"],
 
72
            ["^bzr: ERROR: Could not rename unversioned.txt => elsewhere."
 
73
             " .*unversioned.txt is not versioned\.$"],
75
74
            'mv unversioned.txt elsewhere')
76
75
 
77
76
    def test_mv_nonexisting(self):
78
77
        self.run_bzr_error(
79
 
            ["^brz: ERROR: Could not rename doesnotexist => somewhereelse."
80
 
             " .*doesnotexist is not versioned\\.$"],
 
78
            ["^bzr: ERROR: Could not rename doesnotexist => somewhereelse."
 
79
             " .*doesnotexist is not versioned\.$"],
81
80
            'mv doesnotexist somewhereelse')
82
81
 
83
82
    def test_mv_unqualified(self):
84
 
        self.run_bzr_error(['^brz: ERROR: missing file argument$'], 'mv')
 
83
        self.run_bzr_error(['^bzr: ERROR: missing file argument$'], 'mv')
85
84
 
86
85
    def test_mv_invalid(self):
87
86
        tree = self.make_branch_and_tree('.')
89
88
        tree.add(['test.txt'])
90
89
 
91
90
        self.run_bzr_error(
92
 
            ["^brz: ERROR: Could not move to sub1: sub1 is not versioned\\.$"],
 
91
            ["^bzr: ERROR: Could not move to sub1: sub1 is not versioned\.$"],
93
92
            'mv test.txt sub1')
94
93
 
95
94
        self.run_bzr_error(
96
 
            ["^brz: ERROR: Could not move test.txt => .*hello.txt: "
97
 
             "sub1 is not versioned\\.$"],
 
95
            ["^bzr: ERROR: Could not move test.txt => .*hello.txt: "
 
96
             "sub1 is not versioned\.$"],
98
97
            'mv test.txt sub1/hello.txt')
99
98
 
100
99
    def test_mv_dirs(self):
103
102
        tree.add(['hello.txt', 'sub1'])
104
103
 
105
104
        self.run_bzr('mv sub1 sub2')
106
 
        self.assertMoved('sub1', 'sub2')
 
105
        self.assertMoved('sub1','sub2')
107
106
 
108
107
        self.run_bzr('mv hello.txt sub2')
109
 
        self.assertMoved('hello.txt', 'sub2/hello.txt')
 
108
        self.assertMoved('hello.txt','sub2/hello.txt')
110
109
 
111
110
        self.build_tree(['sub1/'])
112
111
        tree.add(['sub1'])
113
112
        self.run_bzr('mv sub2/hello.txt sub1')
114
 
        self.assertMoved('sub2/hello.txt', 'sub1/hello.txt')
 
113
        self.assertMoved('sub2/hello.txt','sub1/hello.txt')
115
114
 
116
115
        self.run_bzr('mv sub2 sub1')
117
 
        self.assertMoved('sub2', 'sub1/sub2')
 
116
        self.assertMoved('sub2','sub1/sub2')
118
117
 
119
118
    def test_mv_relative(self):
120
119
        self.build_tree(['sub1/', 'sub1/sub2/', 'sub1/hello.txt'])
125
124
        self.assertPathExists('sub1/sub2/hello.txt')
126
125
 
127
126
        self.run_bzr('mv sub2/hello.txt .', working_dir='sub1')
128
 
        self.assertMoved('sub1/sub2/hello.txt', 'sub1/hello.txt')
 
127
        self.assertMoved('sub1/sub2/hello.txt','sub1/hello.txt')
129
128
 
130
129
    def test_mv_change_case_file(self):
131
130
        # test for bug #77740 (mv unable change filename case on Windows)
172
171
        out, err = self.run_bzr('mv bar Foo', retcode=3)
173
172
        self.assertEqual('', out)
174
173
        self.assertEqual(
175
 
            'brz: ERROR: Could not move to Foo: Foo is not versioned.\n',
 
174
            'bzr: ERROR: Could not move to Foo: Foo is not versioned.\n',
176
175
            err)
177
176
 
178
177
    def test_mv_smoke_aliases(self):
188
187
    def test_mv_no_root(self):
189
188
        tree = self.make_branch_and_tree('.')
190
189
        self.run_bzr_error(
191
 
            ["brz: ERROR: can not move root of branch"],
 
190
            ["bzr: ERROR: can not move root of branch"],
192
191
            'mv . a')
193
192
 
194
193
    def test_mv_through_symlinks(self):
197
196
        self.build_tree(['a/', 'a/b'])
198
197
        os.symlink('a', 'c')
199
198
        os.symlink('.', 'd')
200
 
        tree.add(['a', 'a/b', 'c'], [b'a-id', b'b-id', b'c-id'])
 
199
        tree.add(['a', 'a/b', 'c'], ['a-id', 'b-id', 'c-id'])
201
200
        self.run_bzr('mv c/b b')
202
201
        tree = workingtree.WorkingTree.open('.')
203
 
        self.assertEqual(b'b-id', tree.path2id('b'))
 
202
        self.assertEqual('b-id', tree.path2id('b'))
204
203
 
205
204
    def test_mv_already_moved_file(self):
206
 
        """Test brz mv original_file to moved_file.
 
205
        """Test bzr mv original_file to moved_file.
207
206
 
208
207
        Tests if a file which has allready been moved by an external tool,
209
 
        is handled correctly by brz mv.
 
208
        is handled correctly by bzr mv.
210
209
        Setup: a is in the working tree, b does not exist.
211
 
        User does: mv a b; brz mv a b
 
210
        User does: mv a b; bzr mv a b
212
211
        """
213
212
        self.build_tree(['a'])
214
213
        tree = self.make_branch_and_tree('.')
216
215
 
217
216
        osutils.rename('a', 'b')
218
217
        self.run_bzr('mv a b')
219
 
        self.assertMoved('a', 'b')
 
218
        self.assertMoved('a','b')
220
219
 
221
220
    def test_mv_already_moved_file_to_versioned_target(self):
222
 
        """Test brz mv existing_file to versioned_file.
 
221
        """Test bzr mv existing_file to versioned_file.
223
222
 
224
223
        Tests if an attempt to move an existing versioned file
225
224
        to another versiond file will fail.
226
225
        Setup: a and b are in the working tree.
227
 
        User does: rm b; mv a b; brz mv a b
 
226
        User does: rm b; mv a b; bzr mv a b
228
227
        """
229
228
        self.build_tree(['a', 'b'])
230
229
        tree = self.make_branch_and_tree('.')
233
232
        os.remove('b')
234
233
        osutils.rename('a', 'b')
235
234
        self.run_bzr_error(
236
 
            ["^brz: ERROR: Could not move a => b. b is already versioned\\.$"],
 
235
            ["^bzr: ERROR: Could not move a => b. b is already versioned\.$"],
237
236
            'mv a b')
238
 
        # check that nothing changed
 
237
        #check that nothing changed
239
238
        self.assertPathDoesNotExist('a')
240
239
        self.assertPathExists('b')
241
240
 
242
241
    def test_mv_already_moved_file_into_subdir(self):
243
 
        """Test brz mv original_file to versioned_directory/file.
 
242
        """Test bzr mv original_file to versioned_directory/file.
244
243
 
245
244
        Tests if a file which has already been moved into a versioned
246
 
        directory by an external tool, is handled correctly by brz mv.
 
245
        directory by an external tool, is handled correctly by bzr mv.
247
246
        Setup: a and sub/ are in the working tree.
248
 
        User does: mv a sub/a; brz mv a sub/a
 
247
        User does: mv a sub/a; bzr mv a sub/a
249
248
        """
250
249
        self.build_tree(['a', 'sub/'])
251
250
        tree = self.make_branch_and_tree('.')
253
252
 
254
253
        osutils.rename('a', 'sub/a')
255
254
        self.run_bzr('mv a sub/a')
256
 
        self.assertMoved('a', 'sub/a')
 
255
        self.assertMoved('a','sub/a')
257
256
 
258
257
    def test_mv_already_moved_file_into_unversioned_subdir(self):
259
 
        """Test brz mv original_file to unversioned_directory/file.
 
258
        """Test bzr mv original_file to unversioned_directory/file.
260
259
 
261
260
        Tests if an attempt to move an existing versioned file
262
261
        into an unversioned directory will fail.
263
262
        Setup: a is in the working tree, sub/ is not.
264
 
        User does: mv a sub/a; brz mv a sub/a
 
263
        User does: mv a sub/a; bzr mv a sub/a
265
264
        """
266
265
        self.build_tree(['a', 'sub/'])
267
266
        tree = self.make_branch_and_tree('.')
269
268
 
270
269
        osutils.rename('a', 'sub/a')
271
270
        self.run_bzr_error(
272
 
            ["^brz: ERROR: Could not move a => a: sub is not versioned\\.$"],
 
271
            ["^bzr: ERROR: Could not move a => a: sub is not versioned\.$"],
273
272
            'mv a sub/a')
274
273
        self.assertPathDoesNotExist('a')
275
274
        self.assertPathExists('sub/a')
276
275
 
277
276
    def test_mv_already_moved_files_into_subdir(self):
278
 
        """Test brz mv original_files to versioned_directory.
 
277
        """Test bzr mv original_files to versioned_directory.
279
278
 
280
279
        Tests if files which has already been moved into a versioned
281
 
        directory by an external tool, is handled correctly by brz mv.
 
280
        directory by an external tool, is handled correctly by bzr mv.
282
281
        Setup: a1, a2, sub are in the working tree.
283
 
        User does: mv a1 sub/.; brz mv a1 a2 sub
 
282
        User does: mv a1 sub/.; bzr mv a1 a2 sub
284
283
        """
285
284
        self.build_tree(['a1', 'a2', 'sub/'])
286
285
        tree = self.make_branch_and_tree('.')
288
287
 
289
288
        osutils.rename('a1', 'sub/a1')
290
289
        self.run_bzr('mv a1 a2 sub')
291
 
        self.assertMoved('a1', 'sub/a1')
292
 
        self.assertMoved('a2', 'sub/a2')
 
290
        self.assertMoved('a1','sub/a1')
 
291
        self.assertMoved('a2','sub/a2')
293
292
 
294
293
    def test_mv_already_moved_files_into_unversioned_subdir(self):
295
 
        """Test brz mv original_file to unversioned_directory.
 
294
        """Test bzr mv original_file to unversioned_directory.
296
295
 
297
296
        Tests if an attempt to move existing versioned file
298
297
        into an unversioned directory will fail.
299
298
        Setup: a1, a2 are in the working tree, sub is not.
300
 
        User does: mv a1 sub/.; brz mv a1 a2 sub
 
299
        User does: mv a1 sub/.; bzr mv a1 a2 sub
301
300
        """
302
301
        self.build_tree(['a1', 'a2', 'sub/'])
303
302
        tree = self.make_branch_and_tree('.')
305
304
 
306
305
        osutils.rename('a1', 'sub/a1')
307
306
        self.run_bzr_error(
308
 
            ["^brz: ERROR: Could not move to sub. sub is not versioned\\.$"],
 
307
            ["^bzr: ERROR: Could not move to sub. sub is not versioned\.$"],
309
308
            'mv a1 a2 sub')
310
309
        self.assertPathDoesNotExist('a1')
311
310
        self.assertPathExists('sub/a1')
313
312
        self.assertPathDoesNotExist('sub/a2')
314
313
 
315
314
    def test_mv_already_moved_file_forcing_after(self):
316
 
        """Test brz mv versioned_file to unversioned_file.
 
315
        """Test bzr mv versioned_file to unversioned_file.
317
316
 
318
317
        Tests if an attempt to move an existing versioned file to an existing
319
318
        unversioned file will fail, informing the user to use the --after
320
319
        option to force this.
321
320
        Setup: a is in the working tree, b not versioned.
322
 
        User does: mv a b; touch a; brz mv a b
 
321
        User does: mv a b; touch a; bzr mv a b
323
322
        """
324
323
        self.build_tree(['a', 'b'])
325
324
        tree = self.make_branch_and_tree('.')
326
325
        tree.add(['a'])
327
326
 
328
327
        osutils.rename('a', 'b')
329
 
        self.build_tree(['a'])  # touch a
 
328
        self.build_tree(['a']) #touch a
330
329
        self.run_bzr_error(
331
 
            ["^brz: ERROR: Could not rename a => b because both files exist."
332
 
             " \\(Use --after to tell brz about a rename that has already"
333
 
             " happened\\)$"],
 
330
            ["^bzr: ERROR: Could not rename a => b because both files exist."
 
331
             " \(Use --after to tell bzr about a rename that has already"
 
332
             " happened\)$"],
334
333
            'mv a b')
335
334
        self.assertPathExists('a')
336
335
        self.assertPathExists('b')
337
336
 
338
337
    def test_mv_already_moved_file_using_after(self):
339
 
        """Test brz mv --after versioned_file to unversioned_file.
 
338
        """Test bzr mv --after versioned_file to unversioned_file.
340
339
 
341
340
        Tests if an existing versioned file can be forced to move to an
342
341
        existing unversioned file using the --after option. With the result
343
342
        that bazaar considers the unversioned_file to be moved from
344
343
        versioned_file and versioned_file will become unversioned.
345
344
        Setup: a is in the working tree and b exists.
346
 
        User does: mv a b; touch a; brz mv a b --after
 
345
        User does: mv a b; touch a; bzr mv a b --after
347
346
        Resulting in a => b and a is unknown.
348
347
        """
349
348
        self.build_tree(['a', 'b'])
350
349
        tree = self.make_branch_and_tree('.')
351
350
        tree.add(['a'])
352
351
        osutils.rename('a', 'b')
353
 
        self.build_tree(['a'])  # touch a
 
352
        self.build_tree(['a']) #touch a
354
353
 
355
354
        self.run_bzr('mv a b --after')
356
355
        self.assertPathExists('a')
357
 
        self.assertNotInWorkingTree('a')  # a should be unknown now.
 
356
        self.assertNotInWorkingTree('a')#a should be unknown now.
358
357
        self.assertPathExists('b')
359
358
        self.assertInWorkingTree('b')
360
359
 
361
360
    def test_mv_already_moved_files_forcing_after(self):
362
 
        """Test brz mv versioned_files to directory/unversioned_file.
 
361
        """Test bzr mv versioned_files to directory/unversioned_file.
363
362
 
364
363
        Tests if an attempt to move an existing versioned file to an existing
365
364
        unversioned file in some other directory will fail, informing the user
367
366
 
368
367
        Setup: a1, a2, sub are versioned and in the working tree,
369
368
               sub/a1, sub/a2 are in working tree.
370
 
        User does: mv a* sub; touch a1; touch a2; brz mv a1 a2 sub
 
369
        User does: mv a* sub; touch a1; touch a2; bzr mv a1 a2 sub
371
370
        """
372
371
        self.build_tree(['a1', 'a2', 'sub/', 'sub/a1', 'sub/a2'])
373
372
        tree = self.make_branch_and_tree('.')
374
373
        tree.add(['a1', 'a2', 'sub'])
375
374
        osutils.rename('a1', 'sub/a1')
376
375
        osutils.rename('a2', 'sub/a2')
377
 
        self.build_tree(['a1'])  # touch a1
378
 
        self.build_tree(['a2'])  # touch a2
 
376
        self.build_tree(['a1']) #touch a1
 
377
        self.build_tree(['a2']) #touch a2
379
378
 
380
379
        self.run_bzr_error(
381
 
            ["^brz: ERROR: Could not rename a1 => sub/a1 because both files"
382
 
             " exist. \\(Use --after to tell brz about a rename that has already"
383
 
             " happened\\)$"],
 
380
            ["^bzr: ERROR: Could not rename a1 => sub/a1 because both files"
 
381
             " exist. \(Use --after to tell bzr about a rename that has already"
 
382
             " happened\)$"],
384
383
            'mv a1 a2 sub')
385
384
        self.assertPathExists('a1')
386
385
        self.assertPathExists('a2')
388
387
        self.assertPathExists('sub/a2')
389
388
 
390
389
    def test_mv_already_moved_files_using_after(self):
391
 
        """Test brz mv --after versioned_file to directory/unversioned_file.
 
390
        """Test bzr mv --after versioned_file to directory/unversioned_file.
392
391
 
393
392
        Tests if an existing versioned file can be forced to move to an
394
393
        existing unversioned file in some other directory using the --after
398
397
 
399
398
        Setup: a1, a2, sub are versioned and in the working tree,
400
399
               sub/a1, sub/a2 are in working tree.
401
 
        User does: mv a* sub; touch a1; touch a2; brz mv a1 a2 sub --after
 
400
        User does: mv a* sub; touch a1; touch a2; bzr mv a1 a2 sub --after
402
401
        """
403
402
        self.build_tree(['a1', 'a2', 'sub/', 'sub/a1', 'sub/a2'])
404
403
        tree = self.make_branch_and_tree('.')
405
404
        tree.add(['a1', 'a2', 'sub'])
406
405
        osutils.rename('a1', 'sub/a1')
407
406
        osutils.rename('a2', 'sub/a2')
408
 
        self.build_tree(['a1'])  # touch a1
409
 
        self.build_tree(['a2'])  # touch a2
 
407
        self.build_tree(['a1']) #touch a1
 
408
        self.build_tree(['a2']) #touch a2
410
409
 
411
410
        self.run_bzr('mv a1 a2 sub --after')
412
411
        self.assertPathExists('a1')
417
416
        self.assertInWorkingTree('sub/a2')
418
417
 
419
418
    def test_mv_already_moved_directory(self):
420
 
        """Use `brz mv a b` to mark a directory as renamed.
 
419
        """Use `bzr mv a b` to mark a directory as renamed.
421
420
 
422
421
        https://bugs.launchpad.net/bzr/+bug/107967/
423
422
        """
454
453
        self.assertEqual(out, '')
455
454
        self.assertEqual(err, 'a => b\nc => d\n')
456
455
        tree = workingtree.WorkingTree.open('tree')
457
 
        self.assertTrue(tree.is_versioned('b'))
458
 
        self.assertTrue(tree.is_versioned('d'))
 
456
        self.assertIsNot(None, tree.path2id('b'))
 
457
        self.assertIsNot(None, tree.path2id('d'))
459
458
 
460
459
    def test_mv_auto_one_path(self):
461
460
        self.make_abcd_tree()
463
462
        self.assertEqual(out, '')
464
463
        self.assertEqual(err, 'a => b\nc => d\n')
465
464
        tree = workingtree.WorkingTree.open('tree')
466
 
        self.assertTrue(tree.is_versioned('b'))
467
 
        self.assertTrue(tree.is_versioned('d'))
 
465
        self.assertIsNot(None, tree.path2id('b'))
 
466
        self.assertIsNot(None, tree.path2id('d'))
468
467
 
469
468
    def test_mv_auto_two_paths(self):
470
469
        self.make_abcd_tree()
471
470
        out, err = self.run_bzr('mv --auto tree tree2', retcode=3)
472
 
        self.assertEqual('brz: ERROR: Only one path may be specified to'
 
471
        self.assertEqual('bzr: ERROR: Only one path may be specified to'
473
472
                         ' --auto.\n', err)
474
473
 
475
474
    def test_mv_auto_dry_run(self):
478
477
        self.assertEqual(out, '')
479
478
        self.assertEqual(err, 'a => b\nc => d\n')
480
479
        tree = workingtree.WorkingTree.open('tree')
481
 
        self.assertTrue(tree.is_versioned('a'))
482
 
        self.assertTrue(tree.is_versioned('c'))
 
480
        self.assertIsNot(None, tree.path2id('a'))
 
481
        self.assertIsNot(None, tree.path2id('c'))
483
482
 
484
483
    def test_mv_no_auto_dry_run(self):
485
484
        self.make_abcd_tree()
486
485
        out, err = self.run_bzr('mv c d --dry-run',
487
486
                                working_dir='tree', retcode=3)
488
 
        self.assertEqual('brz: ERROR: --dry-run requires --auto.\n', err)
 
487
        self.assertEqual('bzr: ERROR: --dry-run requires --auto.\n', err)
489
488
 
490
489
    def test_mv_auto_after(self):
491
490
        self.make_abcd_tree()
492
491
        out, err = self.run_bzr('mv --auto --after', working_dir='tree',
493
492
                                retcode=3)
494
 
        self.assertEqual('brz: ERROR: --after cannot be specified with'
 
493
        self.assertEqual('bzr: ERROR: --after cannot be specified with'
495
494
                         ' --auto.\n', err)
496
495
 
497
496
    def test_mv_quiet(self):
504
503
 
505
504
    def test_mv_readonly_lightweight_checkout(self):
506
505
        branch = self.make_branch('foo')
507
 
        branch = breezy.branch.Branch.open(self.get_readonly_url('foo'))
 
506
        branch = brzlib.branch.Branch.open(self.get_readonly_url('foo'))
508
507
        tree = branch.create_checkout('tree', lightweight=True)
509
508
        self.build_tree(['tree/path'])
510
509
        tree.add('path')
518
517
        tree = self.make_branch_and_tree(".")
519
518
        self.build_tree([u"\xA7"])
520
519
        out, err = self.run_bzr_error(["Could not rename", "not versioned"],
521
 
                                      ["mv", u"\xA7", "b"])
 
520
            ["mv", u"\xA7", "b"])
522
521
 
523
522
    def test_mv_removed_non_ascii(self):
524
523
        """Clear error on mv of a removed non-ascii file, see lp:898541"""
529
528
        tree.commit(u"Adding \xA7")
530
529
        os.remove(u"\xA7")
531
530
        out, err = self.run_bzr_error(["Could not rename", "not exist"],
532
 
                                      ["mv", u"\xA7", "b"])
533
 
 
534
 
    def test_dupe_move(self):
535
 
        self.script_runner = script.ScriptRunner()
536
 
        self.script_runner.run_script(self, '''
537
 
        $ brz init brz-bug
538
 
        Created a standalone tree (format: 2a)
539
 
        $ cd brz-bug
540
 
        $ mkdir dir
541
 
        $ brz add
542
 
        adding dir
543
 
        $ echo text >> dir/test.txt
544
 
        $ brz add
545
 
        adding dir/test.txt
546
 
        $ brz ci -m "Add files"
547
 
        2>Committing to: .../brz-bug/
548
 
        2>added dir
549
 
        2>added dir/test.txt
550
 
        2>Committed revision 1.
551
 
        $ mv dir dir2
552
 
        $ mv dir2/test.txt dir2/test2.txt
553
 
        $ brz st
554
 
        removed:
555
 
          dir/
556
 
          dir/test.txt
557
 
        unknown:
558
 
          dir2/
559
 
        $ brz mv dir dir2
560
 
        dir => dir2
561
 
        $ brz st
562
 
        removed:
563
 
          dir/test.txt
564
 
        renamed:
565
 
          dir/ => dir2/
566
 
        unknown:
567
 
          dir2/test2.txt
568
 
        $ brz mv dir/test.txt dir2/test2.txt
569
 
        dir/test.txt => dir2/test2.txt
570
 
        ''')
 
531
            ["mv", u"\xA7", "b"])