~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Martin Pool
  • Date: 2005-08-29 10:57:01 UTC
  • mfrom: (1092.1.41)
  • Revision ID: mbp@sourcefrog.net-20050829105701-7aaa81ecf1bfee05
- merge in merge improvements and additional tests 
  from aaron and lifeless

robertc@robertcollins.net-20050825131100-85772edabc817481

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
22
23
 
23
24
import bzrlib.osutils
24
25
import bzrlib.revision
220
221
    """Merge changes into a tree.
221
222
 
222
223
    base_revision
223
 
        Base for three-way merge.
 
224
        tuple(path, revision) Base for three-way merge.
224
225
    other_revision
225
 
        Other revision for three-way merge.
 
226
        tuple(path, revision) Other revision for three-way merge.
226
227
    this_dir
227
228
        Directory to merge changes into; '.' by default.
228
229
    check_clean
258
259
            other_rev_id = None
259
260
            other_basis = other_branch.last_patch()
260
261
        if base_revision == [None, None]:
261
 
            if other_revision[1] == -1:
262
 
                o_revno = None
263
 
            else:
264
 
                o_revno = other_revision[1]
 
262
            base_rev_id = common_ancestor(this_rev_id, other_basis, 
 
263
                                          this_branch)
 
264
            if base_rev_id is None:
265
265
                raise UnrelatedBranches()
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")
 
266
            base_tree = get_revid_tree(this_branch, base_rev_id, tempdir, 
 
267
                                       "base", None)
273
268
            base_is_ancestor = True
274
269
        else:
275
270
            base_branch, base_tree = get_tree(base_revision, tempdir, "base")