~bzr/ubuntu/lucid/bzr/beta-ppa

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_reconcile.py

  • Committer: Martin Pool
  • Date: 2010-08-18 04:26:39 UTC
  • mfrom: (129.1.8 packaging-karmic)
  • Revision ID: mbp@sourcefrog.net-20100818042639-mjoxtngyjwiu05fo
* PPA rebuild for lucid.
* PPA rebuild for karmic.
* PPA rebuild onto jaunty.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006-2010 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
18
18
 
19
19
 
20
20
import bzrlib
21
 
import bzrlib.errors as errors
 
21
from bzrlib import (
 
22
    errors,
 
23
    transport,
 
24
    )
22
25
from bzrlib.inventory import Inventory
23
26
from bzrlib.reconcile import reconcile, Reconciler
24
27
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit
30
33
from bzrlib.tests.per_repository import (
31
34
    TestCaseWithRepository,
32
35
    )
33
 
from bzrlib.transport import get_transport
34
36
from bzrlib.uncommit import uncommit
35
37
 
36
38
 
59
61
    def setUp(self):
60
62
        super(TestsNeedingReweave, self).setUp()
61
63
 
62
 
        t = get_transport(self.get_url())
 
64
        t = transport.get_transport(self.get_url())
63
65
        # an empty inventory with no revision for testing with.
64
66
        repo = self.make_repository('inventory_without_revision')
65
67
        repo.lock_write()
310
312
        self.reduceLockdirTimeout()
311
313
        super(TestReconcileWithIncorrectRevisionCache, self).setUp()
312
314
 
313
 
        t = get_transport(self.get_url())
 
315
        t = transport.get_transport(self.get_url())
314
316
        # we need a revision with two parents in the wrong order
315
317
        # which should trigger reinsertion.
316
318
        # and another with the first one correct but the other two not
379
381
 
380
382
    def test_reconcile_wrong_order(self):
381
383
        # a wrong order in primary parents is optionally correctable
382
 
        t = get_transport(self.get_url()).clone('wrong-first-parent')
 
384
        t = transport.get_transport(self.get_url()).clone('wrong-first-parent')
383
385
        d = bzrlib.bzrdir.BzrDir.open_from_transport(t)
384
386
        repo = d.open_repository()
385
387
        repo.lock_read()
408
410
 
409
411
    def test_reconcile_wrong_order_secondary_inventory(self):
410
412
        # a wrong order in the parents for inventories is ignored.
411
 
        t = get_transport(self.get_url()).clone('reversed-secondary-parents')
 
413
        t = transport.get_transport(self.get_url()
 
414
                                    ).clone('reversed-secondary-parents')
412
415
        d = bzrlib.bzrdir.BzrDir.open_from_transport(t)
413
416
        repo = d.open_repository()
414
417
        self.checkUnreconciled(d, repo.reconcile())