~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2005-10-19 02:40:58 UTC
  • mto: (1185.19.1)
  • mto: This revision was merged to the branch mainline in revision 1474.
  • Revision ID: aaron.bentley@utoronto.ca-20051019024058-4562b385778ee490
Added --show-base to merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
def merge(other_revision, base_revision,
242
242
          check_clean=True, ignore_zero=False,
243
243
          this_dir=None, backup_files=False, merge_type=ApplyMerge3,
244
 
          file_list=None):
 
244
          file_list=None, show_base=False):
245
245
    """Merge changes into a tree.
246
246
 
247
247
    base_revision
324
324
                                          " tree." % fname)
325
325
        merge_inner(this_branch, other_tree, base_tree, tempdir, 
326
326
                    ignore_zero=ignore_zero, backup_files=backup_files, 
327
 
                    merge_type=merge_type, interesting_ids=interesting_ids)
 
327
                    merge_type=merge_type, interesting_ids=interesting_ids,
 
328
                    show_base=show_base)
328
329
        if base_is_ancestor and other_rev_id is not None\
329
330
            and other_rev_id not in this_branch.revision_history():
330
331
            this_branch.add_pending_merge(other_rev_id)
342
343
 
343
344
def merge_inner(this_branch, other_tree, base_tree, tempdir, 
344
345
                ignore_zero=False, merge_type=ApplyMerge3, backup_files=False,
345
 
                interesting_ids=None):
 
346
                interesting_ids=None, show_base=False):
346
347
 
347
348
    def merge_factory(file_id, base, other):
348
 
        contents_change = merge_type(file_id, base, other)
 
349
        if show_base is True:
 
350
            contents_change = merge_type(file_id, base, other, show_base=True)
 
351
        else:
 
352
            contents_change = merge_type(file_id, base, other)
349
353
        if backup_files:
350
354
            contents_change = BackupBeforeChange(contents_change)
351
355
        return contents_change