~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Martin Pool
  • Date: 2005-08-25 09:17:19 UTC
  • Revision ID: mbp@sourcefrog.net-20050825091719-b2d7be7bf56bb35a
- fix a few errors in new merge code

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import tempfile
20
20
import shutil
21
21
import errno
22
 
from fetch import greedy_fetch
23
22
 
24
23
import bzrlib.osutils
25
24
import bzrlib.revision
221
220
    """Merge changes into a tree.
222
221
 
223
222
    base_revision
224
 
        tuple(path, revision) Base for three-way merge.
 
223
        Base for three-way merge.
225
224
    other_revision
226
 
        tuple(path, revision) Other revision for three-way merge.
 
225
        Other revision for three-way merge.
227
226
    this_dir
228
227
        Directory to merge changes into; '.' by default.
229
228
    check_clean
259
258
            other_rev_id = None
260
259
            other_basis = other_branch.last_patch()
261
260
        if base_revision == [None, None]:
262
 
            base_rev_id = common_ancestor(this_rev_id, other_basis, 
263
 
                                          this_branch)
264
 
            if base_rev_id is None:
 
261
            if other_revision[1] == -1:
 
262
                o_revno = None
 
263
            else:
 
264
                o_revno = other_revision[1]
265
265
                raise UnrelatedBranches()
266
 
            base_tree = get_revid_tree(this_branch, base_rev_id, tempdir, 
267
 
                                       "base", None)
 
266
            try:
 
267
                base_revision = this_branch.get_revision(base_rev_id)
 
268
                base_branch = this_branch
 
269
            except NoSuchRevision:
 
270
                base_branch = other_branch
 
271
            base_tree = get_revid_tree(base_branch, base_rev_id, tempdir, 
 
272
                                       "base")
268
273
            base_is_ancestor = True
269
274
        else:
270
275
            base_branch, base_tree = get_tree(base_revision, tempdir, "base")