/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/bundle/serializer/__init__.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-09 12:18:11 UTC
  • mfrom: (7029.2.2 write-bundle-return-order)
  • Revision ID: breezy.the.bot@gmail.com-20180709121811-d8go69481ye1thno
Don't make assumptions about the order of revisions returned by BundleWrite.write_bundle().

Merged from https://code.launchpad.net/~jelmer/brz/write-bundle-return-order/+merge/349070

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    :param base_revision_id: Revision assumed to be present in repositories
115
115
         applying the bundle.
116
116
    :param out: Output file.
 
117
    :return: List of revision ids written
117
118
    """
118
119
    with repository.lock_read():
119
120
        return get_serializer(format).write_bundle(repository, revision_id,
144
145
        :param base: The most recent of ancestor of the revision that does not
145
146
            need to be included in the bundle
146
147
        :param fileobj: The file to output to
 
148
        :return: List of revision ids written
147
149
        """
148
150
        raise NotImplementedError
149
151
 
150
 
    def _write_bundle(self, repository, revision_id, base_revision_id, out):
151
 
        """Helper function for translating write_bundle to write"""
152
 
        forced_bases = {revision_id:base_revision_id}
153
 
        if base_revision_id is NULL_REVISION:
154
 
            base_revision_id = None
155
 
        graph = repository.get_graph()
156
 
        revision_ids = graph.find_unique_ancestors(revision_id,
157
 
            [base_revision_id])
158
 
        revision_ids = list(repository.get_graph().iter_topo_order(
159
 
            revision_ids))
160
 
        revision_ids.reverse()
161
 
        self.write(repository, revision_ids, forced_bases, out)
162
 
        return revision_ids
163
 
 
164
152
 
165
153
def binary_diff(old_filename, old_lines, new_filename, new_lines, to_file):
166
154
    temp = BytesIO()