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

  • Committer: Aaron Bentley
  • Date: 2007-11-27 13:24:44 UTC
  • mto: This revision was merged to the branch mainline in revision 3044.
  • Revision ID: aaron.bentley@utoronto.ca-20071127132444-zq5nq2cs13ljnm6z
Start handling case-insensitivity

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
        transform3.adjust_path('tip', root_id, tip_id)
234
234
        transform3.apply()
235
235
 
 
236
    def test_conflict_on_case_insensitive(self):
 
237
        tree = self.make_branch_and_tree('tree')
 
238
        # Don't try this at home, kids!
 
239
        # Force the tree to report that it is case sensitive, for conflict
 
240
        # resolution tests
 
241
        tree.case_sensitive = True
 
242
        transform = TreeTransform(tree)
 
243
        self.addCleanup(transform.finalize)
 
244
        transform.new_file('file', transform.root, 'content')
 
245
        transform.new_file('FiLe', transform.root, 'content')
 
246
        result = transform.find_conflicts()
 
247
        self.assertEqual([], result)
 
248
        # Force the tree to report that it is case insensitive, for conflict
 
249
        # generation tests
 
250
        tree.case_sensitive = False
 
251
        result = transform.find_conflicts()
 
252
        self.assertEqual([('duplicate', 'new-1', 'new-2', 'file')], result)
 
253
 
 
254
    def test_resolve_case_insensitive_conflict(self):
 
255
        tree = self.make_branch_and_tree('tree')
 
256
        # Don't try this at home, kids!
 
257
        # Force the tree to report that it is case insensitive, for conflict
 
258
        # resolution tests
 
259
        tree.case_sensitive = False
 
260
        transform = TreeTransform(tree)
 
261
        self.addCleanup(transform.finalize)
 
262
        transform.new_file('file', transform.root, 'content')
 
263
        transform.new_file('FiLe', transform.root, 'content')
 
264
        resolve_conflicts(transform)
 
265
        transform.apply()
 
266
        self.failUnlessExists('tree/file')
 
267
        self.failUnlessExists('tree/FiLe.moved')
 
268
 
 
269
    def test_resolve_checkout_conflict(self):
 
270
        tree = self.make_branch_and_tree('tree')
 
271
        # Don't try this at home, kids!
 
272
        # Force the tree to report that it is case insensitive, for conflict
 
273
        # resolution tests
 
274
        tree.case_sensitive = False
 
275
        transform = TreeTransform(tree)
 
276
        self.addCleanup(transform.finalize)
 
277
        transform.new_file('file', transform.root, 'content')
 
278
        transform.new_file('FiLe', transform.root, 'content')
 
279
        resolve_conflicts(transform)
 
280
        transform.apply()
 
281
        self.failUnlessExists('tree/file')
 
282
        self.failUnlessExists('tree/FiLe.moved')
 
283
 
 
284
    def test_case_insensitive_limbo(self):
 
285
        tree = self.make_branch_and_tree('tree')
 
286
        # Don't try this at home, kids!
 
287
        # Force the tree to report that it is case insensitive
 
288
        tree.case_sensitive = False
 
289
        transform = TreeTransform(tree)
 
290
        self.addCleanup(transform.finalize)
 
291
        dir = transform.new_directory('dir', transform.root)
 
292
        first = transform.new_file('file', dir, 'content')
 
293
        second = transform.new_file('FiLe', dir, 'content')
 
294
        self.assertContainsRe(transform._limbo_name(first), 'new-1/file')
 
295
        self.assertNotContainsRe(transform._limbo_name(second), 'new-1/FiLe')
 
296
 
236
297
    def test_add_del(self):
237
298
        start, root = self.get_transform()
238
299
        start.new_directory('a', root, 'a')