~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-09 19:25:42 UTC
  • mto: (5777.5.1 inventoryworkingtree)
  • mto: This revision was merged to the branch mainline in revision 5781.
  • Revision ID: jelmer@samba.org-20110409192542-8bbedp36s7nj928e
Split InventoryTree out of Tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from bzrlib import (
26
26
    branch,
27
27
    bzrdir,
 
28
    repository,
28
29
    tests,
29
30
    upgrade,
30
31
    workingtree,
41
42
 
42
43
    def test_convert_branch5_branch6(self):
43
44
        b = self.make_branch('branch', format='knit')
44
 
        b._set_revision_history(['CD'])
 
45
        b.set_revision_history(['AB', 'CD'])
45
46
        b.set_parent('file:///EF')
46
47
        b.set_bound_location('file:///GH')
47
48
        b.set_push_location('file:///IJ')
108
109
        self.assertEqual(rev_id, new_tree.last_revision())
109
110
        for path in ['basis-inventory-cache', 'inventory', 'last-revision',
110
111
            'pending-merges', 'stat-cache']:
111
 
            self.assertPathDoesNotExist('tree/.bzr/checkout/' + path)
 
112
            self.failIfExists('tree/.bzr/checkout/' + path)
112
113
 
113
114
    def test_convert_knit_merges_dirstate(self):
114
115
        tree = self.make_branch_and_tree('tree', format='knit')
126
127
        self.assertEqual([rev_id2, rev_id3], new_tree.get_parent_ids())
127
128
        for path in ['basis-inventory-cache', 'inventory', 'last-revision',
128
129
            'pending-merges', 'stat-cache']:
129
 
            self.assertPathDoesNotExist('tree/.bzr/checkout/' + path)
 
130
            self.failIfExists('tree/.bzr/checkout/' + path)
130
131
 
131
132
 
132
133
class TestSmartUpgrade(tests.TestCaseWithTransport):
147
148
        self.assertLength(1, worked)
148
149
        self.assertEqual(worked[0], control)
149
150
        self.assertLength(0, issues)
150
 
        self.assertPathExists('branch1/backup.bzr.~1~')
 
151
        self.failUnlessExists('branch1/backup.bzr.~1~')
151
152
        self.assertEqual(control.open_repository()._format,
152
153
                         self.to_format._repository_format)
153
154
 
160
161
        self.assertLength(1, worked)
161
162
        self.assertEqual(worked[0], control)
162
163
        self.assertLength(0, issues)
163
 
        self.assertPathExists('branch1')
164
 
        self.assertPathExists('branch1/.bzr')
165
 
        self.assertPathDoesNotExist('branch1/backup.bzr.~1~')
 
164
        self.failUnlessExists('branch1')
 
165
        self.failUnlessExists('branch1/.bzr')
 
166
        self.failIfExists('branch1/backup.bzr.~1~')
166
167
        self.assertEqual(control.open_repository()._format,
167
168
                         self.to_format._repository_format)
168
169
 
186
187
        self.assertLength(3, worked)
187
188
        self.assertEqual(worked[0], control)
188
189
        self.assertLength(0, issues)
189
 
        self.assertPathExists('repo/backup.bzr.~1~')
190
 
        self.assertPathExists('repo/branch1/backup.bzr.~1~')
191
 
        self.assertPathExists('repo/branch2/backup.bzr.~1~')
 
190
        self.failUnlessExists('repo/backup.bzr.~1~')
 
191
        self.failUnlessExists('repo/branch1/backup.bzr.~1~')
 
192
        self.failUnlessExists('repo/branch2/backup.bzr.~1~')
192
193
        self.assertEqual(control.open_repository()._format,
193
194
                         self.to_format._repository_format)
194
195
        b1 = branch.Branch.open('repo/branch1')
203
204
        self.assertLength(3, worked)
204
205
        self.assertEqual(worked[0], control)
205
206
        self.assertLength(0, issues)
206
 
        self.assertPathExists('repo')
207
 
        self.assertPathExists('repo/.bzr')
208
 
        self.assertPathDoesNotExist('repo/backup.bzr.~1~')
209
 
        self.assertPathDoesNotExist('repo/branch1/backup.bzr.~1~')
210
 
        self.assertPathDoesNotExist('repo/branch2/backup.bzr.~1~')
 
207
        self.failUnlessExists('repo')
 
208
        self.failUnlessExists('repo/.bzr')
 
209
        self.failIfExists('repo/backup.bzr.~1~')
 
210
        self.failIfExists('repo/branch1/backup.bzr.~1~')
 
211
        self.failIfExists('repo/branch2/backup.bzr.~1~')
211
212
        self.assertEqual(control.open_repository()._format,
212
213
                         self.to_format._repository_format)
213
214
        b1 = branch.Branch.open('repo/branch1')