~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
413
413
        self.failUnlessExists('checkout/file')
414
414
        self.assertEqual(['A'], old_tree.get_parent_ids())
415
415
 
 
416
    def test_update_sets_root_id(self):
 
417
        """Ensure tree root is set properly by update.
 
418
        
 
419
        Since empty trees don't have root_ids, but workingtrees do,
 
420
        an update of a checkout of revision 0 to a new revision,  should set
 
421
        the root id.
 
422
        """
 
423
        wt = self.make_branch_and_tree('tree')
 
424
        main_branch = wt.branch
 
425
        # create an out of date working tree by making a checkout in this
 
426
        # current format
 
427
        self.build_tree(['checkout/', 'tree/file'])
 
428
        checkout = main_branch.create_checkout('checkout')
 
429
        # now commit to 'tree'
 
430
        wt.add('file')
 
431
        wt.commit('A', rev_id='A')
 
432
        # and update checkout 
 
433
        self.assertEqual(0, checkout.update())
 
434
        self.failUnlessExists('checkout/file')
 
435
        self.assertEqual(wt.get_root_id(), checkout.get_root_id())
 
436
        self.assertNotEqual(None, wt.get_root_id())
 
437
 
416
438
    def test_update_returns_conflict_count(self):
417
439
        # working tree formats from the meta-dir format and newer support
418
440
        # setting the last revision on a tree independently of that on the