~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/weave_fmt/test_bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-10 07:46:15 UTC
  • mfrom: (5844 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5845.
  • Revision ID: jelmer@samba.org-20110510074615-eptod049ndjxc4i7
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011 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
297
297
        t = self.get_transport('.')
298
298
        t.delete_multi(['.bzr/pending-merges', '.bzr/inventory'])
299
299
        self.assertFalse(t.has('.bzr/stat-cache'))
300
 
        # XXX: upgrade fails if a backup.bzr is already present
301
 
        # -- David Allouche 2006-08-11
302
300
        t.delete_tree('backup.bzr.~1~')
303
301
        # At this point, we have a format6 branch without checkout files.
304
302
        upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1())
308
306
        # We have covered the scope of this test, we may as well check that
309
307
        # upgrade has not eaten our data, even if it's a bit redundant with
310
308
        # other tests.
311
 
        self.failUnless(isinstance(control._format, bzrdir.BzrDirMetaFormat1))
 
309
        self.assertIsInstance(control._format, bzrdir.BzrDirMetaFormat1)
312
310
        b = control.open_branch()
313
311
        self.assertEquals(b.revision_history(),
314
312
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
322
320
        control = bzrdir.BzrDir.open('.')
323
321
        b = control.open_branch()
324
322
        # tsk, peeking under the covers.
325
 
        self.failUnless(
326
 
            isinstance(
327
 
                control._format,
328
 
                bzrdir.BzrDirFormat.get_default_format().__class__))
 
323
        self.assertIsInstance(
 
324
            control._format,
 
325
            bzrdir.BzrDirFormat.get_default_format().__class__)
329
326
        rh = b.revision_history()
330
327
        eq(rh,
331
328
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
421
418
        # old format branches use a special lock file on sftp.
422
419
        b = self.make_branch('', format=BzrDirFormat6())
423
420
        b = branch.Branch.open(self.get_url())
424
 
        self.failUnlessExists('.bzr/')
425
 
        self.failUnlessExists('.bzr/branch-format')
426
 
        self.failUnlessExists('.bzr/branch-lock')
 
421
        self.assertPathExists('.bzr/')
 
422
        self.assertPathExists('.bzr/branch-format')
 
423
        self.assertPathExists('.bzr/branch-lock')
427
424
 
428
 
        self.failIf(lexists('.bzr/branch-lock.write-lock'))
 
425
        self.assertPathDoesNotExist('.bzr/branch-lock.write-lock')
429
426
        b.lock_write()
430
 
        self.failUnlessExists('.bzr/branch-lock.write-lock')
 
427
        self.assertPathExists('.bzr/branch-lock.write-lock')
431
428
        b.unlock()
432
 
        self.failIf(lexists('.bzr/branch-lock.write-lock'))
 
429
        self.assertPathDoesNotExist('.bzr/branch-lock.write-lock')
433
430
 
434
431
 
435
432
class TestInfo(TestCaseWithTransport):