~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Martin Pool
  • Date: 2006-03-09 07:14:10 UTC
  • mfrom: (1600 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1602.
  • Revision ID: mbp@sourcefrog.net-20060309071410-4ab7d54905541c75
[merge] from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
350
350
            self.cook_conflicts(fs_conflicts)
351
351
            for line in conflicts_strings(self.cooked_conflicts):
352
352
                warning(line)
353
 
            self.tt.apply()
 
353
            results = self.tt.apply()
354
354
        finally:
355
355
            try:
356
356
                self.tt.finalize()
357
357
            except:
358
358
                pass
359
 
       
 
359
        self.write_modified(results)
 
360
 
 
361
    def write_modified(self, results):
 
362
        modified_hashes = {}
 
363
        for path in results.modified_paths:
 
364
            file_id = self.this_tree.path2id(self.this_tree.relpath(path))
 
365
            if file_id is None:
 
366
                continue
 
367
            hash = self.this_tree.get_file_sha1(file_id)
 
368
            if hash is None:
 
369
                continue
 
370
            modified_hashes[file_id] = hash
 
371
        self.this_tree.set_merge_modified(modified_hashes)
 
372
 
360
373
    @staticmethod
361
374
    def parent(entry, file_id):
362
375
        """Determine the parent for a file_id (used as a key method)"""
749
762
        this_revision_id = self.this_revision_tree.inventory[file_id].revision
750
763
        other_revision_id = \
751
764
            self.other_revision_tree.inventory[file_id].revision
752
 
        this_i = weave.lookup(this_revision_id)
753
 
        other_i = weave.lookup(other_revision_id)
754
 
        plan =  weave.plan_merge(this_i, other_i)
 
765
        plan =  weave.plan_merge(this_revision_id, other_revision_id)
755
766
        return weave.weave_merge(plan, '<<<<<<< TREE\n', 
756
767
                                       '>>>>>>> MERGE-SOURCE\n')
757
768
 
835
846
    merger.backup_files = backup_files
836
847
    merger.merge_type = merge_type
837
848
    merger.interesting_ids = interesting_ids
 
849
    merger.ignore_zero = ignore_zero
838
850
    if interesting_files:
839
851
        assert not interesting_ids, ('Only supply interesting_ids'
840
852
                                     ' or interesting_files')