/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2007-02-09 15:56:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2288.
  • Revision ID: abentley@panoramicfeedback.com-20070209155649-qxg6cqptrwyd4xof
Apply change reporting to merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
class Merger(object):
89
89
    def __init__(self, this_branch, other_tree=None, base_tree=None, 
90
 
                 this_tree=None, pb=DummyProgress()):
 
90
                 this_tree=None, pb=DummyProgress(), change_reporter=None):
91
91
        object.__init__(self)
92
92
        assert this_tree is not None, "this_tree is required"
93
93
        self.this_branch = this_branch
105
105
        self.reprocess = False
106
106
        self._pb = pb 
107
107
        self.pp = None
108
 
 
 
108
        self.change_reporter = change_reporter
109
109
 
110
110
    def revision_tree(self, revision_id):
111
111
        return self.this_branch.repository.revision_tree(revision_id)
268
268
        elif self.show_base:
269
269
            raise BzrError("Showing base is not supported for this"
270
270
                                  " merge type. %s" % self.merge_type)
271
 
        merge = self.merge_type(pb=self._pb, **kwargs)
 
271
        merge = self.merge_type(pb=self._pb,
 
272
                                change_reporter=self.change_reporter,
 
273
                                **kwargs)
272
274
        if len(merge.cooked_conflicts) == 0:
273
275
            if not self.ignore_zero:
274
276
                note("All changes applied successfully.")
356
358
 
357
359
    def __init__(self, working_tree, this_tree, base_tree, other_tree, 
358
360
                 interesting_ids=None, reprocess=False, show_base=False,
359
 
                 pb=DummyProgress(), pp=None):
 
361
                 pb=DummyProgress(), pp=None, change_reporter=None):
360
362
        """Initialize the merger object and perform the merge."""
361
363
        object.__init__(self)
362
364
        self.this_tree = working_tree
368
370
        self.show_base = show_base
369
371
        self.pb = pb
370
372
        self.pp = pp
 
373
        self.change_reporter = change_reporter
371
374
        if self.pp is None:
372
375
            self.pp = ProgressPhase("Merge phase", 3, self.pb)
373
376
 
396
399
                fs_conflicts = resolve_conflicts(self.tt, child_pb)
397
400
            finally:
398
401
                child_pb.finished()
 
402
            if change_reporter is not None:
 
403
                import delta
 
404
                delta.report_changes(self.tt._iter_changes(), change_reporter)
399
405
            self.cook_conflicts(fs_conflicts)
400
406
            for conflict in self.cooked_conflicts:
401
407
                warning(conflict)