~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fetch.py

  • Committer: Aaron Bentley
  • Date: 2007-02-16 07:02:19 UTC
  • mfrom: (2292 +trunk)
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070216070219-b22k0gwnisnxawnk
Merged bzr.dev (17 tests failing)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.bzrdir import BzrDir
24
24
from bzrlib.builtins import merge
25
25
import bzrlib.errors
 
26
from bzrlib.repofmt import knitrepo
26
27
from bzrlib.tests import TestCaseWithTransport
27
28
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
28
29
from bzrlib.tests.test_revision import make_branches
95
96
    br_a2.append_revision('a-b-c')
96
97
    self.assertRaises(bzrlib.errors.InstallFailed, br_a3.fetch, br_a2)
97
98
 
98
 
    # TODO: jam 20051218 Branch should no longer allow append_revision for revisions
99
 
    #       which don't exist. So this test needs to be rewritten
100
 
    #       RBC 20060403 the way to do this is to uncommit the revision from the
101
 
    #           repository after the commit
 
99
    # TODO: ADHB 20070116 Perhaps set_last_revision shouldn't accept
 
100
    #       revisions which are not present?  In that case, this test
 
101
    #       must be rewritten.
 
102
    #
 
103
    #       RBC 20060403 the way to do this is to uncommit the revision from
 
104
    #       the repository after the commit
102
105
 
103
106
    #TODO: test that fetch correctly does reweaving when needed. RBC 20051008
104
107
    # Note that this means - updating the weave when ghosts are filled in to 
123
126
        corresponding filename, parent, contents or other changes.
124
127
        """
125
128
        knit1_format = bzrdir.BzrDirMetaFormat1()
126
 
        knit1_format.repository_format = repository.RepositoryFormatKnit1()
 
129
        knit1_format.repository_format = knitrepo.RepositoryFormatKnit1()
127
130
        knit2_format = bzrdir.BzrDirMetaFormat1()
128
 
        knit2_format.repository_format = repository.RepositoryFormatKnit2()
 
131
        knit2_format.repository_format = knitrepo.RepositoryFormatKnit2()
129
132
        # we start with a knit1 repository because that causes the
130
133
        # root revision to change for each commit, even though the content,
131
134
        # parent, name, and other attributes are unchanged.
271
274
        self.assertEqual(1, self._count_log_matches('inventory.kndx', http_logs))
272
275
        # this r-h check test will prevent regressions, but it currently already 
273
276
        # passes, before the patch to cache-rh is applied :[
274
 
        self.assertEqual(1, self._count_log_matches('revision-history', http_logs))
 
277
        self.assertTrue(1 >= self._count_log_matches('revision-history',
 
278
                                                     http_logs))
 
279
        self.assertTrue(1 >= self._count_log_matches('last-revision',
 
280
                                                     http_logs))
275
281
        # FIXME naughty poking in there.
276
282
        self.get_readonly_server().logs = []
277
283
        # check there is nothing more to fetch
284
290
        self.assertEqual(1, self._count_log_matches('branch-format', http_logs))
285
291
        self.assertEqual(1, self._count_log_matches('branch/format', http_logs))
286
292
        self.assertEqual(1, self._count_log_matches('repository/format', http_logs))
287
 
        self.assertEqual(1, self._count_log_matches('revision-history', http_logs))
 
293
        self.assertTrue(1 >= self._count_log_matches('revision-history',
 
294
                                                     http_logs))
 
295
        self.assertTrue(1 >= self._count_log_matches('last-revision',
 
296
                                                     http_logs))
288
297
        self.assertEqual(4, len(http_logs))