~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
import bzrlib.inventory
49
49
import bzrlib.iterablefile
50
50
import bzrlib.lockdir
 
51
from bzrlib.merge import merge_inner
51
52
import bzrlib.merge3
52
53
import bzrlib.osutils
53
54
import bzrlib.osutils as osutils
54
55
import bzrlib.plugin
 
56
from bzrlib.revision import common_ancestor
55
57
import bzrlib.store
56
58
import bzrlib.trace
57
59
from bzrlib.transport import urlescape, get_transport
327
329
    def assertTransportMode(self, transport, path, mode):
328
330
        """Fail if a path does not have mode mode.
329
331
        
330
 
        If modes are not supported on this platform, the test is skipped.
 
332
        If modes are not supported on this transport, the assertion is ignored.
331
333
        """
332
 
        if sys.platform == 'win32':
 
334
        if not transport._can_roundtrip_unix_modebits():
333
335
            return
334
336
        path_stat = transport.stat(path)
335
337
        actual_mode = stat.S_IMODE(path_stat.st_mode)
549
551
            sys.stderr = real_stderr
550
552
            sys.stdin = real_stdin
551
553
 
 
554
    def merge(self, branch_from, wt_to):
 
555
        """A helper for tests to do a ui-less merge.
 
556
 
 
557
        This should move to the main library when someone has time to integrate
 
558
        it in.
 
559
        """
 
560
        # minimal ui-less merge.
 
561
        wt_to.branch.fetch(branch_from)
 
562
        base_rev = common_ancestor(branch_from.last_revision(),
 
563
                                   wt_to.branch.last_revision(),
 
564
                                   wt_to.branch.repository)
 
565
        merge_inner(wt_to.branch, branch_from.basis_tree(), 
 
566
                    wt_to.branch.repository.revision_tree(base_rev),
 
567
                    this_tree=wt_to)
 
568
        wt_to.add_pending_merge(branch_from.last_revision())
 
569
 
552
570
 
553
571
BzrTestBase = TestCase
554
572
 
935
953
                   'bzrlib.tests.test_diff',
936
954
                   'bzrlib.tests.test_doc_generate',
937
955
                   'bzrlib.tests.test_errors',
 
956
                   'bzrlib.tests.test_escaped_store',
938
957
                   'bzrlib.tests.test_fetch',
939
958
                   'bzrlib.tests.test_gpg',
940
959
                   'bzrlib.tests.test_graph',
979
998
                   'bzrlib.tests.test_transport',
980
999
                   'bzrlib.tests.test_tsort',
981
1000
                   'bzrlib.tests.test_ui',
982
 
                   'bzrlib.tests.test_uncommit',
983
1001
                   'bzrlib.tests.test_upgrade',
984
1002
                   'bzrlib.tests.test_versionedfile',
985
1003
                   'bzrlib.tests.test_weave',