~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_revert.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-03 13:53:46 UTC
  • mto: This revision was merged to the branch mainline in revision 5826.
  • Revision ID: jelmer@samba.org-20110503135346-l2f6xnenzn3320gv
Kill annotate_file_revision_tree() in favor annotate_file_tree().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2007 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
import os
20
20
 
21
21
import bzrlib.osutils
22
 
from bzrlib.tests.blackbox import ExternalBase
 
22
from bzrlib.tests import TestCaseWithTransport
23
23
from bzrlib.trace import mutter
24
24
from bzrlib.workingtree import WorkingTree
25
25
 
26
26
 
27
 
class TestRevert(ExternalBase):
 
27
class TestRevert(TestCaseWithTransport):
28
28
 
29
29
    def _prepare_tree(self):
30
30
        self.run_bzr('init')
93
93
        """Test that revert DIRECTORY does what's expected"""
94
94
        self._prepare_rename_mod_tree()
95
95
        self.run_bzr('revert a')
96
 
        self.failUnlessExists('a/b')
97
 
        self.failUnlessExists('a/d')
98
 
        self.failIfExists('a/g')
 
96
        self.assertPathExists('a/b')
 
97
        self.assertPathExists('a/d')
 
98
        self.assertPathDoesNotExist('a/g')
99
99
        self.expectFailure(
100
100
            "j is in the delta revert applies because j was renamed too",
101
 
            self.failUnlessExists, 'j')
102
 
        self.failUnlessExists('h')
 
101
            self.assertPathExists, 'j')
 
102
        self.assertPathExists('h')
103
103
        self.run_bzr('revert f')
104
 
        self.failIfExists('j')
105
 
        self.failIfExists('h')
106
 
        self.failUnlessExists('a/d/e')
 
104
        self.assertPathDoesNotExist('j')
 
105
        self.assertPathDoesNotExist('h')
 
106
        self.assertPathExists('a/d/e')
107
107
 
108
108
    def test_revert_chatter(self):
109
109
        self._prepare_rename_mod_tree()
148
148
            self.run_bzr('commit -m f')
149
149
            os.unlink('symlink')
150
150
            self.run_bzr('revert')
151
 
            self.failUnlessExists('symlink')
 
151
            self.assertPathExists('symlink')
152
152
            os.unlink('symlink')
153
153
            os.symlink('a-different-path', 'symlink')
154
154
            self.run_bzr('revert')