~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Robert Collins
  • Date: 2006-04-12 04:57:34 UTC
  • mto: This revision was merged to the branch mainline in revision 1654.
  • Revision ID: robertc@robertcollins.net-20060412045734-3e03b7af0860a5a9
 * 'pull' and 'push' now normalise the revision history, so that any two
   branches with the same tip revision will have the same output from 'log'.
   (Robert Collins)

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
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