48
48
def fetch_steps(self, br_a, br_b, writable_a):
49
49
"""A foreign test method for testing fetch locally and remotely."""
51
51
# TODO RBC 20060201 make this a repository test.
52
52
repo_b = br_b.repository
53
53
self.assertFalse(repo_b.has_revision(br_a.revision_history()[3]))
74
74
self.assertEqual(writable_a.fetch(br_b)[0], 1)
75
75
self.assertTrue(has_revision(br_a, br_b.revision_history()[3]))
76
76
self.assertTrue(has_revision(br_a, br_b.revision_history()[4]))
78
78
br_b2 = self.make_branch('br_b2')
79
79
self.assertEquals(br_b2.fetch(br_b)[0], 7)
80
80
self.assertTrue(has_revision(br_b2, br_b.revision_history()[4]))
88
88
self.assertTrue(has_revision(br_a2, br_a.revision_history()[2]))
90
90
br_a3 = self.make_branch('br_a3')
91
# pulling a branch with no revisions grabs nothing, regardless of
91
# pulling a branch with no revisions grabs nothing, regardless of
92
92
# whats in the inventory.
93
93
self.assertEquals(br_a3.fetch(br_a2)[0], 0)
94
94
for revno in range(4):
109
109
# every branch supports that. -- mbp 20070814
111
111
#TODO: test that fetch correctly does reweaving when needed. RBC 20051008
112
# Note that this means - updating the weave when ghosts are filled in to
112
# Note that this means - updating the weave when ghosts are filled in to
113
113
# add the right parents.
127
127
def test_fetch_root_knit(self):
128
128
"""Ensure that knit2.fetch() updates the root knit
130
130
This tests the case where the root has a new revision, but there are no
131
131
corresponding filename, parent, contents or other changes.
285
285
target = BzrDir.create_branch_and_repo("target/")
286
286
source = Branch.open(self.get_readonly_url("source/"))
287
287
self.assertEqual(target.fetch(source), (2, []))
288
# this is the path to the literal file. As format changes
288
# this is the path to the literal file. As format changes
289
289
# occur it needs to be updated. FIXME: ask the store for the
291
291
self.log("web server logs are:")
292
292
http_logs = self.get_readonly_server().logs
293
293
self.log('\n'.join(http_logs))
294
# unfortunately this log entry is branch format specific. We could
295
# factor out the 'what files does this format use' to a method on the
294
# unfortunately this log entry is branch format specific. We could
295
# factor out the 'what files does this format use' to a method on the
296
296
# repository, which would let us to this generically. RBC 20060419
297
297
# RBC 20080408: Or perhaps we can assert that no files are fully read
299
299
self.assertEqual(1, self._count_log_matches('/ce/id.kndx', http_logs))
300
300
self.assertEqual(1, self._count_log_matches('/ce/id.knit', http_logs))
301
301
self.assertEqual(1, self._count_log_matches('inventory.kndx', http_logs))
302
# this r-h check test will prevent regressions, but it currently already
302
# this r-h check test will prevent regressions, but it currently already
303
303
# passes, before the patch to cache-rh is applied :[
304
304
self.assertTrue(1 >= self._count_log_matches('revision-history',