~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-25 02:10:04 UTC
  • mto: (1092.1.41) (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: aaron.bentley@utoronto.ca-20050825021004-a7afd22f3dd52b2e
pending merges, common ancestor work properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
    all available ancestors of other_revision and base_revision are
215
215
    automatically pulled into the branch.
216
216
    """
217
 
    from bzrlib.revision import common_ancestor, MultipleRevisionSources
 
217
    from bzrlib.revision import common_ancestor, is_ancestor
 
218
    from bzrlib.revision import MultipleRevisionSources
218
219
    from bzrlib.errors import NoSuchRevision
219
220
    tempdir = tempfile.mkdtemp(prefix="bzr-")
220
221
    try:
241
242
            other_rev_id = None
242
243
            other_basis = other_branch.last_patch()
243
244
        if base_revision == [None, None]:
244
 
            if other_revision[1] == -1:
245
 
                o_revno = None
246
 
            else:
247
 
                o_revno = other_revision[1]
 
245
            base_rev_id = common_ancestor(this_rev_id, other_basis, 
 
246
                                          this_branch)
 
247
            if base_rev_id is None:
248
248
                raise UnrelatedBranches()
249
 
            try:
250
 
                base_revision = this_branch.get_revision(base_rev_id)
251
 
                base_branch = this_branch
252
 
            except NoSuchRevision:
253
 
                base_branch = other_branch
254
 
            base_tree = get_revid_tree(base_branch, base_rev_id, tempdir, 
255
 
                                       "base")
 
249
            base_tree = get_revid_tree(this_branch, base_rev_id, tempdir, 
 
250
                                       "base", None)
256
251
            base_is_ancestor = True
257
252
        else:
258
253
            base_branch, base_tree = get_tree(base_revision, tempdir, "base")