/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 breezy/tests/blackbox/test_filesystem_cicp.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-04 00:16:27 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7318.
  • Revision ID: jelmer@jelmer.uk-20190304001627-v6u7o6pf97tukhek
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    )
32
32
 
33
33
 
34
 
 
35
34
class TestCICPBase(tests.TestCaseWithTransport):
36
35
    """Base class for tests on a case-insensitive, case-preserving filesystem.
37
36
    """
46
45
        self.build_tree_contents([('CamelCaseParent/CamelCase', b'camel case'),
47
46
                                  ('lowercaseparent/lowercase', b'lower case'),
48
47
                                  ('lowercaseparent/mixedCase', b'mixedCasecase'),
49
 
                                 ])
 
48
                                  ])
50
49
        return wt
51
50
 
52
51
 
175
174
        # Remove the source and create a destination file on disk with a different case.
176
175
        # brz should report that the filename is already versioned.
177
176
        os.unlink('CamelCaseParent/CamelCase')
178
 
        osutils.rename('lowercaseparent/lowercase', 'lowercaseparent/LOWERCASE')
 
177
        osutils.rename('lowercaseparent/lowercase',
 
178
                       'lowercaseparent/LOWERCASE')
179
179
        run_script(self, """
180
180
            $ brz mv --after camelcaseparent/camelcase LOWERCASEPARENT/LOWERCASE
181
181
            2>brz: ERROR: Could not move CamelCase => lowercase: \
215
215
            CamelCaseParent/CamelCase => CamelCaseParent/camelCase
216
216
            """)
217
217
        self.assertEqual(canonical_relpath(wt.basedir, 'camelcaseparent/camelcase'),
218
 
                             'CamelCaseParent/camelCase')
 
218
                         'CamelCaseParent/camelCase')
219
219
 
220
220
    def test_mv_newcase_after(self):
221
221
        wt = self._make_mixed_case_tree()
224
224
 
225
225
        # perform a mv to the new case - we must ensure the file-system has the
226
226
        # new case first.
227
 
        osutils.rename('CamelCaseParent/CamelCase', 'CamelCaseParent/camelCase')
 
227
        osutils.rename('CamelCaseParent/CamelCase',
 
228
                       'CamelCaseParent/camelCase')
228
229
        run_script(self, """
229
230
            $ brz mv --after camelcaseparent/camelcase camelcaseparent/camelCase
230
231
            CamelCaseParent/CamelCase => CamelCaseParent/camelCase
231
232
            """)
232
233
        # brz should not have renamed the file to a different case
233
234
        self.assertEqual(canonical_relpath(wt.basedir, 'camelcaseparent/camelcase'),
234
 
                             'CamelCaseParent/camelCase')
 
235
                         'CamelCaseParent/camelCase')
235
236
 
236
237
    def test_mv_multiple(self):
237
238
        wt = self._make_mixed_case_tree()
276
277
        for expected in ['lowercaseparent/lowercase', 'CamelCaseParent/CamelCase']:
277
278
            self.assertContainsRe(got, 'deleted ' + expected + '\n')
278
279
 
279
 
 
280
280
    # The following commands need tests and/or cicp lovin':
281
281
    # update, remove, file_id, file_path, diff, log, touching_revisions, ls,
282
282
    # ignore, cat, revert, resolve.