~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revert.py

  • Committer: Martin Pool
  • Date: 2007-06-15 07:01:24 UTC
  • mfrom: (2528 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2530.
  • Revision ID: mbp@sourcefrog.net-20070615070124-clpwqh5gxc4wbf9l
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
import os
17
18
 
18
19
from bzrlib import merge, tests, transform, workingtree
19
20
 
108
109
        tt.apply()
109
110
        transform.revert(tree, tree.basis_tree(), [])
110
111
        self.assertTrue(tree.is_executable('newfile-id'))
 
112
 
 
113
    def test_revert_deletes_files_from_revert(self):
 
114
        tree = self.make_branch_and_tree('.')
 
115
        self.build_tree(['file'])
 
116
        tree.add('file')
 
117
        tree.commit('added file', rev_id='rev1')
 
118
        os.unlink('file')
 
119
        tree.commit('removed file')
 
120
        self.failIfExists('file')
 
121
        tree.revert([], old_tree=tree.branch.repository.revision_tree('rev1'))
 
122
        self.failUnlessExists('file')
 
123
        tree.revert([])
 
124
        self.failIfExists('file')
 
125
        self.assertEqual({}, tree.merge_modified())