~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Patch Queue Manager
  • Date: 2011-11-29 10:47:47 UTC
  • mfrom: (6282.3.13 884270-merge-po)
  • Revision ID: pqm@pqm.ubuntu.com-20111129104747-32qen0v8yxbxeoov
(vila) Smarter .po file merging with merge hook as a plugin: po_merge.
 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
            params.winner == 'other' or
141
141
            # THIS and OTHER aren't both files.
142
142
            not params.is_file_merge() or
143
 
            # The filename doesn't match *.xml
 
143
            # The filename doesn't match
144
144
            not self.file_matches(params)):
145
145
            return 'not_applicable', None
146
146
        return self.merge_matching(params)
855
855
        else:
856
856
            entries = self._entries_lca()
857
857
            resolver = self._lca_multi_way
 
858
        # Prepare merge hooks
 
859
        factories = Merger.hooks['merge_file_content']
 
860
        # One hook for each registered one plus our default merger
 
861
        hooks = [factory(self) for factory in factories] + [self]
 
862
        self.active_hooks = [hook for hook in hooks if hook is not None]
858
863
        child_pb = ui.ui_factory.nested_progress_bar()
859
864
        try:
860
 
            factories = Merger.hooks['merge_file_content']
861
 
            hooks = [factory(self) for factory in factories] + [self]
862
 
            self.active_hooks = [hook for hook in hooks if hook is not None]
863
865
            for num, (file_id, changed, parents3, names3,
864
866
                      executable3) in enumerate(entries):
865
 
                child_pb.update(gettext('Preparing file merge'), num, len(entries))
 
867
                # Try merging each entry
 
868
                child_pb.update(gettext('Preparing file merge'),
 
869
                                num, len(entries))
866
870
                self._merge_names(file_id, parents3, names3, resolver=resolver)
867
871
                if changed:
868
872
                    file_status = self._do_merge_contents(file_id)