~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revert.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-26 20:55:33 UTC
  • mfrom: (1551.19.9 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20071126205533-5vehpxjf6uk2n8fy
Revert of single files in deleted directories works

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
            ' as of bzr 0.91.  Please use None (the default) instead.'],
133
133
            tree.revert, [])
134
134
        self.assertIs(None, tree.path2id('file'))
 
135
 
 
136
    def test_revert_file_in_deleted_dir(self):
 
137
        tree = self.make_branch_and_tree('.')
 
138
        self.build_tree(['dir/', 'dir/file1', 'dir/file2'])
 
139
        tree.add(['dir', 'dir/file1', 'dir/file2'],
 
140
                 ['dir-id', 'file1-id', 'file2-id'])
 
141
        tree.commit("Added files")
 
142
        os.unlink('dir/file1')
 
143
        os.unlink('dir/file2')
 
144
        os.rmdir('dir')
 
145
        tree.remove(['dir/', 'dir/file1', 'dir/file2'])
 
146
        tree.revert(['dir/file1'])
 
147
        self.failUnlessExists('dir/file1')
 
148
        self.failIfExists('dir/file2')
 
149
        self.assertEqual('dir-id', tree.path2id('dir'))