/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 breezy/git/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2020-06-28 19:19:25 UTC
  • mto: (7490.40.35 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200628191925-o0wi4nfpw7rd14ns
Avoid using file ids in log.

Show diffs side-by-side

added added

removed removed

Lines of Context:
551
551
            raise ValueError('invalid revision id %s' % revision_id)
552
552
        return GitRevisionTree(self, revision_id)
553
553
 
554
 
    def get_deltas_for_revisions(self, revisions, specific_fileids=None):
555
 
        """Produce a generator of revision deltas.
556
 
 
557
 
        Note that the input is a sequence of REVISIONS, not revision_ids.
558
 
        Trees will be held in memory until the generator exits.
559
 
        Each delta is relative to the revision's lefthand predecessor.
560
 
 
561
 
        :param specific_fileids: if not None, the result is filtered
562
 
          so that only those file-ids, their parents and their
563
 
          children are included.
564
 
        """
565
 
        # Get the revision-ids of interest
566
 
        required_trees = set()
567
 
        for revision in revisions:
568
 
            required_trees.add(revision.revision_id)
569
 
            required_trees.update(revision.parent_ids[:1])
570
 
 
571
 
        trees = dict((t.get_revision_id(), t) for
572
 
                     t in self.revision_trees(required_trees))
573
 
 
574
 
        # Calculate the deltas
575
 
        for revision in revisions:
576
 
            if not revision.parent_ids:
577
 
                old_tree = self.revision_tree(_mod_revision.NULL_REVISION)
578
 
            else:
579
 
                old_tree = trees[revision.parent_ids[0]]
580
 
            new_tree = trees[revision.revision_id]
581
 
            if specific_fileids is not None:
582
 
                specific_files = [new_tree.id2path(
583
 
                    fid) for fid in specific_fileids]
584
 
            else:
585
 
                specific_files = None
586
 
            yield new_tree.changes_from(
587
 
                old_tree, specific_files=specific_files)
588
 
 
589
554
    def set_make_working_trees(self, trees):
590
555
        raise errors.UnsupportedOperation(self.set_make_working_trees, self)
591
556