~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.py

Merge bzr.dev.

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