/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 breezy/tests/blackbox/test_repair_workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2018-04-02 00:52:27 UTC
  • mfrom: (6939 work)
  • mto: This revision was merged to the branch mainline in revision 7274.
  • Revision ID: jelmer@jelmer.uk-20180402005227-pecflp1mvdjrjqd6
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
        # manually corrupt. If we change the way to get at that dirstate file,
30
30
        # then we can update how this is done
31
31
        self.assertIsNot(None, getattr(tree, 'current_dirstate', None))
32
 
        tree.lock_read()
33
 
        try:
 
32
        with tree.lock_read():
34
33
            dirstate = tree.current_dirstate()
35
34
            dirstate_path = dirstate._filename
36
35
            self.assertPathExists(dirstate_path)
37
 
        finally:
38
 
            tree.unlock()
39
36
        # We have to have the tree unlocked at this point, so we can safely
40
37
        # mutate the state file on all platforms.
41
38
        if completely:
68
65
    def test_repair_forced(self):
69
66
        tree = self.make_initial_tree()
70
67
        tree.rename_one('dir', 'alt_dir')
71
 
        self.assertIsNot(None, tree.path2id('alt_dir'))
 
68
        self.assertTrue(tree.is_versioned('alt_dir'))
72
69
        self.run_bzr('repair-workingtree -d tree --force')
73
70
        # This requires the tree has reloaded the working state
74
 
        self.assertIs(None, tree.path2id('alt_dir'))
 
71
        self.assertFalse(tree.is_versioned('alt_dir'))
75
72
        self.assertPathExists('tree/alt_dir')
76
73
 
77
74
    def test_repair_corrupted_dirstate(self):