~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Martin Pool
  • Date: 2007-03-03 02:21:25 UTC
  • mto: (2255.2.180 subtree)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: mbp@sourcefrog.net-20070303022125-m66a0pccahokfj2k
Add more dirstate root-id-changing tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
454
454
                     ('a', '', 0, False, ''),
455
455
                     ]),
456
456
                ]
 
457
            state._validate()
457
458
            self.assertEqual(expected_rows, list(state._iter_entries()))
458
459
            # should work across save too
459
460
            state.save()
463
464
        state = dirstate.DirState.on_file('dirstate')
464
465
        state.lock_read()
465
466
        try:
 
467
            state._validate()
466
468
            self.assertEqual(expected_rows, list(state._iter_entries()))
467
469
        finally:
468
470
            state.unlock()
 
471
        # now change within an existing file-backed state
 
472
        state.lock_write()
 
473
        try:
 
474
            state._validate()
 
475
            state.set_path_id('', 'tree-root-2')
 
476
            state._validate()
 
477
        finally:
 
478
            state.unlock()
 
479
 
469
480
 
470
481
    def test_set_parent_trees_no_content(self):
471
482
        # set_parent_trees is a slow but important api to support.