~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/serializer/v08.py

  • Committer: John Arbash Meinel
  • Date: 2008-09-26 22:14:42 UTC
  • mto: This revision was merged to the branch mainline in revision 3747.
  • Revision ID: john@arbash-meinel.com-20080926221442-3r67j99sr9rwe9w0
Make message optional, don't check the memory flag directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from bzrlib import errors
23
23
from bzrlib.bundle.serializer import (BundleSerializer,
24
 
                                      BUNDLE_HEADER,
 
24
                                      _get_bundle_header,
25
25
                                     )
26
26
from bzrlib.bundle.serializer import binary_diff
27
27
from bzrlib.bundle.bundle_data import (RevisionInfo, BundleInfo, BundleTree)
128
128
        finally:
129
129
            source.unlock()
130
130
 
 
131
    def write_bundle(self, repository, target, base, fileobj):
 
132
        return self._write_bundle(repository, target, base, fileobj)
 
133
 
131
134
    def _write_main_header(self):
132
135
        """Write the header for the changes"""
133
136
        f = self.to_file
134
 
        f.write(BUNDLE_HEADER)
135
 
        f.write('0.8\n')
 
137
        f.write(_get_bundle_header('0.8'))
136
138
        f.write('#\n')
137
139
 
138
140
    def _write(self, key, value, indent=1, trailing_space_when_empty=False):
144
146
            If this parameter is True, and value is the empty string, we will
145
147
            write an extra space.
146
148
        """
147
 
        assert indent > 0, 'indentation must be greater than 0'
 
149
        if indent < 1:
 
150
            raise ValueError('indentation must be greater than 0')
148
151
        f = self.to_file
149
152
        f.write('#' + (' ' * indent))
150
153
        f.write(key.encode('utf-8'))
521
524
            action, lines, do_continue = self._read_one_patch()
522
525
            if action is not None:
523
526
                revision_actions.append((action, lines))
524
 
        assert self.info.revisions[-1].tree_actions is None
 
527
        if self.info.revisions[-1].tree_actions is not None:
 
528
            raise AssertionError()
525
529
        self.info.revisions[-1].tree_actions = revision_actions
526
530
 
527
531
    def _read_footer(self):