~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revert.py

  • Committer: Aaron Bentley
  • Date: 2007-06-01 05:43:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2500.
  • Revision ID: aaron.bentley@utoronto.ca-20070601054311-15wtrjil1onbuea3
Revert does not try to preserve file contents produced by revert

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())