/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/bundle/serializer/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from __future__ import absolute_import
21
21
 
22
22
import base64
23
 
from StringIO import StringIO
24
23
import re
25
24
 
26
 
from bzrlib import (
 
25
from ... import (
27
26
    errors,
28
27
    pyutils,
29
28
    )
30
 
from bzrlib.diff import internal_diff
31
 
from bzrlib.revision import NULL_REVISION
 
29
from ...diff import internal_diff
 
30
from ...revision import NULL_REVISION
 
31
from ...sixish import (
 
32
    BytesIO,
 
33
    )
32
34
# For backwards-compatibility
33
 
from bzrlib.timestamp import unpack_highres_date, format_highres_date
 
35
from ...timestamp import unpack_highres_date, format_highres_date
34
36
 
35
37
 
36
38
# New bundles should try to use this header format
201
203
 
202
204
 
203
205
def binary_diff(old_filename, old_lines, new_filename, new_lines, to_file):
204
 
    temp = StringIO()
 
206
    temp = BytesIO()
205
207
    internal_diff(old_filename, old_lines, new_filename, new_lines, temp,
206
208
                  allow_binary=True)
207
209
    temp.seek(0)
208
210
    base64.encode(temp, to_file)
209
211
    to_file.write('\n')
210
212
 
211
 
register_lazy('0.8', 'bzrlib.bundle.serializer.v08', 'BundleSerializerV08')
212
 
register_lazy('0.9', 'bzrlib.bundle.serializer.v09', 'BundleSerializerV09')
213
 
register_lazy(v4_string, 'bzrlib.bundle.serializer.v4',
 
213
register_lazy('0.8', 'breezy.bundle.serializer.v08', 'BundleSerializerV08')
 
214
register_lazy('0.9', 'breezy.bundle.serializer.v09', 'BundleSerializerV09')
 
215
register_lazy(v4_string, 'breezy.bundle.serializer.v4',
214
216
              'BundleSerializerV4')
215
 
register_lazy(None, 'bzrlib.bundle.serializer.v4', 'BundleSerializerV4')
 
217
register_lazy(None, 'breezy.bundle.serializer.v4', 'BundleSerializerV4')
216
218