~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fetch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-31 12:22:44 UTC
  • mfrom: (1551.15.77 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070731122244-f1jemfecukeevugw
Clean up merge command, support arbitrary revisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib import (
22
22
    bzrdir,
23
23
    errors,
 
24
    merge,
24
25
    repository,
25
26
    )
26
27
from bzrlib.branch import Branch
27
28
from bzrlib.bzrdir import BzrDir
28
 
from bzrlib.builtins import merge
29
29
import bzrlib.errors
30
30
from bzrlib.repofmt import knitrepo
31
31
from bzrlib.tests import TestCaseWithTransport
179
179
        wt2 = self.make_branch_and_tree('br2')
180
180
        br2 = wt2.branch
181
181
        wt2.commit(message='rev 2-1', rev_id='2-1')
182
 
        merge(other_revision=['br1', -1], base_revision=['br1', 0],
183
 
              this_dir='br2')
 
182
        wt2.merge_from_branch(br1, from_revision='null:')
184
183
        self._check_revs_present(br2)
185
184
 
186
185
    def test_merge_fetches(self):
191
190
        dir_2 = br1.bzrdir.sprout('br2')
192
191
        br2 = dir_2.open_branch()
193
192
        wt1.commit(message='rev 1-2', rev_id='1-2')
194
 
        dir_2.open_workingtree().commit(message='rev 2-1', rev_id='2-1')
195
 
        merge(other_revision=['br1', -1], base_revision=[None, None], 
196
 
              this_dir='br2')
 
193
        wt2 = dir_2.open_workingtree()
 
194
        wt2.commit(message='rev 2-1', rev_id='2-1')
 
195
        wt2.merge_from_branch(br1)
197
196
        self._check_revs_present(br2)
198
197
 
199
198
    def _check_revs_present(self, br2):
228
227
    def test_merge_fetches_file_history(self):
229
228
        """Merge brings across file histories"""
230
229
        br2 = Branch.open('br2')
231
 
        merge(other_revision=['br1', -1], base_revision=[None, None], 
232
 
              this_dir='br2')
 
230
        br1 = Branch.open('br1')
 
231
        wt2 = WorkingTree.open('br2').merge_from_branch(br1)
233
232
        for rev_id, text in [('1-2', 'original from 1\n'),
234
233
                             ('1-3', 'agreement\n'),
235
234
                             ('2-1', 'contents in 2\n'),