~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_core.py

[merge] Dennis Duchier, some cleanups of the bzr merge code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    def __ne__(self, other):
34
34
        return not (self == other)
35
35
 
36
 
    def apply(self, filename, conflict_handler, reverse=False):
 
36
    def apply(self, filename, conflict_handler):
37
37
        new_file = filename+".new" 
38
 
        if not reverse:
39
 
            base = self.base
40
 
            other = self.other
41
 
        else:
42
 
            base = self.other
43
 
            other = self.base
 
38
        base = self.base
 
39
        other = self.other
44
40
        def get_lines(tree):
45
41
            if self.file_id not in tree:
46
42
                raise Exception("%s not in tree" % self.file_id)
99
95
    def __ne__(self, other):
100
96
        return not (self == other)
101
97
 
102
 
    def apply(self, filename, conflict_handler, reverse=False):
 
98
    def apply(self, filename, conflict_handler):
103
99
        this_i = self.weave.lookup(self.this_revision_id)
104
100
        other_i = self.weave.lookup(self.other_revision_id)
105
101
        plan = self.weave.plan_merge(this_i, other_i)
135
131
    def __ne__(self, other):
136
132
        return not (self == other)
137
133
 
138
 
    def apply(self, filename, conflict_handler, reverse=False):
 
134
    def apply(self, filename, conflict_handler):
139
135
        backup_file(filename)
140
 
        self.contents_change.apply(filename, conflict_handler, reverse)
 
136
        self.contents_change.apply(filename, conflict_handler)
141
137
 
142
138
 
143
139
def invert_invent(inventory):
158
154
    new_cset = make_merge_changeset(cset, this, base, other, 
159
155
                                    conflict_handler, merge_factory)
160
156
    result = apply_changeset(new_cset, invert_invent(this.inventory),
161
 
                             this.basedir, conflict_handler, False)
 
157
                             this.basedir, conflict_handler)
162
158
    return result
163
159
    
164
160
 
329
325
        self.other_tree = other_tree
330
326
        self.file_id = file_id
331
327
 
332
 
    def apply(self, filename, conflict_handler, reverse=False):
333
 
        if not reverse:
334
 
            base = self.base_tree
335
 
            other = self.other_tree
336
 
        else:
337
 
            base = self.other_tree
338
 
            other = self.base_tree
 
328
    def apply(self, filename, conflict_handler):
 
329
        base = self.base_tree
 
330
        other = self.other_tree
339
331
        base_exec_flag = base.is_executable(self.file_id)
340
332
        other_exec_flag = other.is_executable(self.file_id)
341
333
        this_mode = os.stat(filename).st_mode