~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2005-10-24 15:56:15 UTC
  • mfrom: (1185.16.99)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1488.
  • Revision ID: abentley@panoramicfeedback.com-20051024155615-6af1ed78ba9e4f9f
Merge from mpool

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
from bzrlib.revision import common_ancestor, MultipleRevisionSources
38
38
from bzrlib.errors import NoSuchRevision
39
39
 
 
40
# TODO: Report back as changes are merged in
 
41
 
40
42
# TODO: build_working_dir can be built on something simpler than merge()
41
43
 
42
44
# FIXME: merge() parameters seem oriented towards the command line
260
262
    """Merge changes into a tree.
261
263
 
262
264
    base_revision
263
 
        tuple(path, revision) Base for three-way merge.
 
265
        tuple(path, revno) Base for three-way merge.  
 
266
        If (None, None) then a base will be automatically determined.
264
267
    other_revision
265
 
        tuple(path, revision) Other revision for three-way merge.
 
268
        tuple(path, revno) Other revision for three-way merge.
266
269
    this_dir
267
270
        Directory to merge changes into; '.' by default.
268
271
    check_clean
271
274
    ignore_zero - If true, suppress the "zero conflicts" message when 
272
275
        there are no conflicts; should be set when doing something we expect
273
276
        to complete perfectly.
 
277
    file_list - If true, merge only changes to selected files.
274
278
 
275
279
    All available ancestors of other_revision and base_revision are
276
280
    automatically pulled into the branch.
 
281
 
 
282
    The revno may be -1 to indicate the last revision on the branch, which is the 
 
283
    typical case.
 
284
 
 
285
    This function is intended for use from the command line; programmatic clients 
 
286
    might prefer to call merge_inner(), which has less magic behavior.
277
287
    """
 
288
    # TODO: please check this docstring is true and accurate - mbp 20051024
278
289
    if this_dir is None:
279
290
        this_dir = '.'
280
291
    this_branch = Branch.open_containing(this_dir)[0]
438
449
            self.other_basis = other_branch.last_revision()
439
450
            if self.other_basis is None:
440
451
                raise NoCommits(other_branch)
 
452
        fetch(from_branch=other_branch, to_branch=self.this_branch, 
 
453
              last_revision=self.other_basis)
441
454
 
442
455
    def set_base(self, base_revision):
 
456
        mutter("doing merge() with no base_revision specified")
443
457
        if base_revision == [None, None]:
444
458
            try:
445
459
                self.base_rev_id = common_ancestor(self.this_basis,