~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_core.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:
9
9
 
10
10
class ApplyMerge3:
11
11
    """Contents-change wrapper around merge3.Merge3"""
12
 
    def __init__(self, file_id, base, other):
 
12
    def __init__(self, file_id, base, other, show_base=False):
13
13
        self.file_id = file_id
14
14
        self.base = base
15
15
        self.other = other
 
16
        self.show_base = show_base
16
17
 
17
18
    def is_creation(self):
18
19
        return False
49
50
        new_conflicts = False
50
51
        output_file = file(new_file, "wb")
51
52
        start_marker = "!START OF MERGE CONFLICT!" + "I HOPE THIS IS UNIQUE"
 
53
        if self.show_base is True:
 
54
            base_marker = '|' * 7
 
55
        else:
 
56
            base_marker = None
52
57
        for line in m3.merge_lines(name_a = "TREE", name_b = "MERGE-SOURCE", 
53
 
                       start_marker=start_marker):
 
58
                       name_base = "BASE-REVISION",
 
59
                       start_marker=start_marker, base_marker=base_marker):
54
60
            if line.startswith(start_marker):
55
61
                new_conflicts = True
56
62
                output_file.write(line.replace(start_marker, '<' * 7))