~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Lalo Martins
  • Date: 2005-09-09 11:37:44 UTC
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050909113744-22f870db25a9e5f5
getting rid of everything that calls the Branch constructor directly

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.changeset import generate_changeset, ExceptionConflictHandler
28
28
from bzrlib.changeset import Inventory, Diff3Merge
29
29
from bzrlib.branch import find_branch
30
 
from bzrlib.errors import BzrCommandError, UnrelatedBranches, NoCommonAncestor
31
 
from bzrlib.errors import NoCommits
 
30
from bzrlib.errors import BzrCommandError, UnrelatedBranches
32
31
from bzrlib.delta import compare_trees
33
32
from bzrlib.trace import mutter, warning
34
33
from bzrlib.fetch import greedy_fetch
140
139
    elif revno == -1:
141
140
        revision = branch.last_patch()
142
141
    else:
143
 
        revision = branch.lookup_revision(revno)
 
142
        revision = branch.get_rev_id(revno)
144
143
    return branch, get_revid_tree(branch, revision, temp_root, label,
145
144
                                  local_branch)
146
145
 
257
256
                                            this_branch)
258
257
        if other_revision[1] == -1:
259
258
            other_rev_id = other_branch.last_patch()
260
 
            if other_rev_id is None:
261
 
                raise NoCommits(other_branch)
262
259
            other_basis = other_rev_id
263
260
        elif other_revision[1] is not None:
264
 
            other_rev_id = other_branch.lookup_revision(other_revision[1])
 
261
            other_rev_id = other_branch.get_rev_id(other_revision[1])
265
262
            other_basis = other_rev_id
266
263
        else:
267
264
            other_rev_id = None
268
265
            other_basis = other_branch.last_patch()
269
 
            if other_basis is None:
270
 
                raise NoCommits(other_branch)
271
266
        if base_revision == [None, None]:
272
 
            try:
273
 
                base_rev_id = common_ancestor(this_rev_id, other_basis, 
274
 
                                              this_branch)
275
 
            except NoCommonAncestor:
 
267
            base_rev_id = common_ancestor(this_rev_id, other_basis, 
 
268
                                          this_branch)
 
269
            if base_rev_id is None:
276
270
                raise UnrelatedBranches()
277
271
            base_tree = get_revid_tree(this_branch, base_rev_id, tempdir, 
278
272
                                       "base", None)
284
278
            elif base_revision[1] is None:
285
279
                base_rev_id = None
286
280
            else:
287
 
                base_rev_id = base_branch.lookup_revision(base_revision[1])
 
281
                base_rev_id = base_branch.get_rev_id(base_revision[1])
288
282
            if base_rev_id is not None:
289
283
                base_is_ancestor = is_ancestor(this_rev_id, base_rev_id, 
290
284
                                               MultipleRevisionSources(this_branch,