~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_parents.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-23 15:29:35 UTC
  • mfrom: (3943.7.7 bzr.code_style_cleanup)
  • mto: This revision was merged to the branch mainline in revision 4033.
  • Revision ID: john@arbash-meinel.com-20090223152935-oel9m92mwcc6nb4h
Merge the removal of all trailing whitespace, and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        uncommit(tree.branch, tree=tree)
267
267
        tree.add_parent_tree_id(first_revision)
268
268
        self.assertConsistentParents([first_revision], tree)
269
 
        
 
269
 
270
270
    def test_add_first_parent_id_ghost_rejects(self):
271
271
        """Test adding the first parent id - as a ghost"""
272
272
        tree = self.make_branch_and_tree('.')
273
273
        self.assertRaises(errors.GhostRevisionUnusableHere,
274
274
            tree.add_parent_tree_id, 'first-revision')
275
 
        
 
275
 
276
276
    def test_add_first_parent_id_ghost_force(self):
277
277
        """Test adding the first parent id - as a ghost"""
278
278
        tree = self.make_branch_and_tree('.')
285
285
        tree.add_parent_tree_id('first-revision', allow_leftmost_as_ghost=True)
286
286
        tree.add_parent_tree_id('second')
287
287
        self.assertConsistentParents(['first-revision', 'second'], tree)
288
 
        
 
288
 
289
289
    def test_add_second_parent_id(self):
290
290
        """Test adding the second parent id"""
291
291
        tree = self.make_branch_and_tree('.')
294
294
        second_revision = tree.commit('second post')
295
295
        tree.add_parent_tree_id(first_revision)
296
296
        self.assertConsistentParents([second_revision, first_revision], tree)
297
 
        
 
297
 
298
298
    def test_add_second_parent_id_ghost(self):
299
299
        """Test adding the second parent id - as a ghost"""
300
300
        tree = self.make_branch_and_tree('.')
301
301
        first_revision = tree.commit('first post')
302
302
        tree.add_parent_tree_id('second')
303
303
        self.assertConsistentParents([first_revision, 'second'], tree)
304
 
        
 
304
 
305
305
    def test_add_first_parent_tree(self):
306
306
        """Test adding the first parent id"""
307
307
        tree = self.make_branch_and_tree('.')
310
310
        tree.add_parent_tree((first_revision,
311
311
            tree.branch.repository.revision_tree(first_revision)))
312
312
        self.assertConsistentParents([first_revision], tree)
313
 
        
 
313
 
314
314
    def test_add_first_parent_tree_ghost_rejects(self):
315
315
        """Test adding the first parent id - as a ghost"""
316
316
        tree = self.make_branch_and_tree('.')
317
317
        self.assertRaises(errors.GhostRevisionUnusableHere,
318
318
            tree.add_parent_tree, ('first-revision', None))
319
 
        
 
319
 
320
320
    def test_add_first_parent_tree_ghost_force(self):
321
321
        """Test adding the first parent id - as a ghost"""
322
322
        tree = self.make_branch_and_tree('.')
323
323
        tree.add_parent_tree(('first-revision', None),
324
324
            allow_leftmost_as_ghost=True)
325
325
        self.assertConsistentParents(['first-revision'], tree)
326
 
        
 
326
 
327
327
    def test_add_second_parent_tree(self):
328
328
        """Test adding the second parent id"""
329
329
        tree = self.make_branch_and_tree('.')
333
333
        tree.add_parent_tree((first_revision,
334
334
            tree.branch.repository.revision_tree(first_revision)))
335
335
        self.assertConsistentParents([second_revision, first_revision], tree)
336
 
        
 
336
 
337
337
    def test_add_second_parent_tree_ghost(self):
338
338
        """Test adding the second parent id - as a ghost"""
339
339
        tree = self.make_branch_and_tree('.')
344
344
 
345
345
class UpdateToOneParentViaDeltaTests(TestCaseWithWorkingTree):
346
346
    """Tests for the update_basis_by_delta call.
347
 
    
 
347
 
348
348
    This is intuitively defined as 'apply an inventory delta to the basis and
349
349
    discard other parents', but for trees that have an inventory that is not
350
350
    managed as a tree-by-id, the implementation requires roughly duplicated