/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 bzrlib/tests/blackbox/test_revert.py

  • Committer: Martin Pool
  • Date: 2007-10-03 08:06:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2901.
  • Revision ID: mbp@sourcefrog.net-20071003080644-oivy0gkg98sex0ed
Avoid internal error tracebacks on failure to lock on readonly transport (#129701).

Add new LockFailed, which doesn't imply that we failed to get it because of
contention.  Raise this if we fail to create the pending or lock directories
because of Transport errors.

UnlockableTransport is not an internal error.

ReadOnlyLockError has a message which didn't match its name or usage; it's now
deprecated and callers are updated to use LockFailed which is more appropriate.

Add zero_ninetytwo deprecation symbol.

Unify assertMatchesRe with TestCase.assertContainsRe.

When the constructor is deprecated, just say that the class is deprecated, not
the __init__ method - this works better with applyDeprecated in tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Black-box tests for bzr revert."""
18
18
 
46
46
        self.assertEquals('modified:\n  dir/file\n', self.run_bzr('status')[0])
47
47
 
48
48
    def _prepare_rename_mod_tree(self):
49
 
        self.build_tree(['a/', 'a/b', 'a/c', 'a/d/', 'a/d/e', 'f/', 'f/g',
 
49
        self.build_tree(['a/', 'a/b', 'a/c', 'a/d/', 'a/d/e', 'f/', 'f/g', 
50
50
                         'f/h', 'f/i'])
51
51
        self.run_bzr('init')
52
52
        self.run_bzr('add')
96
96
        self.failUnlessExists('a/b')
97
97
        self.failUnlessExists('a/d')
98
98
        self.failIfExists('a/g')
99
 
        self.expectFailure(
100
 
            "j is in the delta revert applies because j was renamed too",
101
 
            self.failUnlessExists, 'j')
 
99
        self.failUnlessExists('j')
102
100
        self.failUnlessExists('h')
103
101
        self.run_bzr('revert f')
104
102
        self.failIfExists('j')
156
154
                             os.readlink('symlink'))
157
155
        else:
158
156
            self.log("skipping revert symlink tests")
159
 
 
 
157
        
160
158
        file('hello', 'wt').write('xyz')
161
159
        self.run_bzr('commit -m xyz hello')
162
160
        self.run_bzr('revert -r 1 hello')