~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Robert Collins
  • Date: 2005-09-30 02:54:51 UTC
  • mfrom: (1395)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050930025451-47b9e412202be44b
symlink and weaves, whaddya know

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
31
30
from bzrlib.errors import NoCommits
32
31
from bzrlib.delta import compare_trees
33
32
from bzrlib.trace import mutter, warning
34
 
from bzrlib.fetch import greedy_fetch
 
33
from bzrlib.fetch import greedy_fetch, fetch
35
34
from bzrlib.revision import is_ancestor
36
35
from bzrlib.osutils import rename
 
36
from bzrlib.revision import common_ancestor, MultipleRevisionSources
 
37
from bzrlib.errors import NoSuchRevision
37
38
 
38
39
 
39
40
# comments from abentley on irc: merge happens in two stages, each
140
141
    if revno is None:
141
142
        revision = None
142
143
    elif revno == -1:
143
 
        revision = branch.last_patch()
 
144
        revision = branch.last_revision()
144
145
    else:
145
146
        revision = branch.get_rev_id(revno)
146
147
    return branch, get_revid_tree(branch, revision, temp_root, label,
245
246
    check_clean
246
247
        If true, this_dir must have no uncommitted changes before the
247
248
        merge begins.
248
 
    all available ancestors of other_revision and base_revision are
 
249
 
 
250
    All available ancestors of other_revision and base_revision are
249
251
    automatically pulled into the branch.
250
252
    """
251
 
    from bzrlib.revision import common_ancestor, MultipleRevisionSources
252
 
    from bzrlib.errors import NoSuchRevision
253
253
    tempdir = tempfile.mkdtemp(prefix="bzr-")
254
254
    try:
255
255
        if this_dir is None:
256
256
            this_dir = '.'
257
257
        this_branch = Branch.open_containing(this_dir)
258
 
        this_rev_id = this_branch.last_patch()
 
258
        this_rev_id = this_branch.last_revision()
259
259
        if this_rev_id is None:
260
260
            raise BzrCommandError("This branch has no commits")
261
261
        if check_clean:
266
266
        other_branch, other_tree = get_tree(other_revision, tempdir, "other",
267
267
                                            this_branch)
268
268
        if other_revision[1] == -1:
269
 
            other_rev_id = other_branch.last_patch()
 
269
            other_rev_id = other_branch.last_revision()
270
270
            if other_rev_id is None:
271
271
                raise NoCommits(other_branch)
272
272
            other_basis = other_rev_id
275
275
            other_basis = other_rev_id
276
276
        else:
277
277
            other_rev_id = None
278
 
            other_basis = other_branch.last_patch()
 
278
            other_basis = other_branch.last_revision()
279
279
            if other_basis is None:
280
280
                raise NoCommits(other_branch)
281
281
        if base_revision == [None, None]:
290
290
        else:
291
291
            base_branch, base_tree = get_tree(base_revision, tempdir, "base")
292
292
            if base_revision[1] == -1:
293
 
                base_rev_id = base_branch.last_patch()
 
293
                base_rev_id = base_branch.last_revision()
294
294
            elif base_revision[1] is None:
295
295
                base_rev_id = None
296
296
            else:
297
297
                base_rev_id = base_branch.get_rev_id(base_revision[1])
298
 
            multi_source = MultipleRevisionSources(this_branch, base_branch)
 
298
            fetch(from_branch=base_branch, to_branch=this_branch)
299
299
            base_is_ancestor = is_ancestor(this_rev_id, base_rev_id,
300
 
                                           multi_source)
 
300
                                           this_branch)
301
301
        if file_list is None:
302
302
            interesting_ids = None
303
303
        else: