~a1s/brz/3.2-windows-installer

« back to all changes in this revision

Viewing changes to breezy/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
 
75
75
    # all clients should supply tree roots.
76
76
    record_root_entry = True
77
 
    # whether this commit builder supports the record_entry_contents interface
78
 
    supports_record_entry_contents = False
79
77
    # whether this commit builder will automatically update the branch that is
80
78
    # being committed to
81
79
    updates_branch = False
201
199
        else:
202
200
            self.random_revid = False
203
201
 
204
 
    def will_record_deletes(self):
205
 
        """Tell the commit builder that deletes are being notified.
206
 
 
207
 
        This enables the accumulation of an inventory delta; for the resulting
208
 
        commit to be valid, deletes against the basis MUST be recorded via
209
 
        builder.record_delete().
210
 
        """
211
 
        raise NotImplementedError(self.will_record_deletes)
212
 
 
213
202
    def record_iter_changes(self, tree, basis_revision_id, iter_changes):
214
203
        """Record a new tree via iter_changes.
215
204
 
833
822
 
834
823
    def get_revisions(self, revision_ids):
835
824
        """Get many revisions at once.
836
 
        
837
 
        Repositories that need to check data on every revision read should 
 
825
 
 
826
        Repositories that need to check data on every revision read should
838
827
        subclass this method.
839
828
        """
840
 
        raise NotImplementedError(self.get_revisions)
 
829
        revs = {}
 
830
        for revid, rev in self.iter_revisions(revision_ids):
 
831
            if rev is None:
 
832
                raise errors.NoSuchRevision(self, revid)
 
833
            revs[revid] = rev
 
834
        return [revs[revid] for revid in revision_ids]
 
835
 
 
836
    def iter_revisions(self, revision_ids):
 
837
        """Iterate over revision objects.
 
838
 
 
839
        :param revision_ids: An iterable of revisions to examine. None may be
 
840
            passed to request all revisions known to the repository. Note that
 
841
            not all repositories can find unreferenced revisions; for those
 
842
            repositories only referenced ones will be returned.
 
843
        :return: An iterator of (revid, revision) tuples. Absent revisions (
 
844
            those asked for but not available) are returned as (revid, None).
 
845
            N.B.: Revisions are not necessarily yielded in order.
 
846
        """
 
847
        raise NotImplementedError(self.iter_revisions)
841
848
 
842
849
    def get_deltas_for_revisions(self, revisions, specific_fileids=None):
843
850
        """Produce a generator of revision deltas.