~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

enhanced set_path_id_with_parents test

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
                     ('a', '', 0, False, ''),
478
478
                     ]),
479
479
                ]
 
480
            state._validate()
480
481
            self.assertEqual(expected_rows, list(state._iter_entries()))
481
482
            # should work across save too
482
483
            state.save()
486
487
        state = dirstate.DirState.on_file('dirstate')
487
488
        state.lock_read()
488
489
        try:
 
490
            state._validate()
489
491
            self.assertEqual(expected_rows, list(state._iter_entries()))
490
492
        finally:
491
493
            state.unlock()
 
494
        # now change within an existing file-backed state
 
495
        state.lock_write()
 
496
        try:
 
497
            state._validate()
 
498
            state.set_path_id('', 'tree-root-2')
 
499
            state._validate()
 
500
        finally:
 
501
            state.unlock()
 
502
 
492
503
 
493
504
    def test_set_parent_trees_no_content(self):
494
505
        # set_parent_trees is a slow but important api to support.