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

  • Committer: Robert Collins
  • Date: 2010-05-06 23:41:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506234135-yivbzczw1sejxnxc
Lock methods on ``Tree``, ``Branch`` and ``Repository`` are now
expected to return an object which can be used to unlock them. This reduces
duplicate code when using cleanups. The previous 'tokens's returned by
``Branch.lock_write`` and ``Repository.lock_write`` are now attributes
on the result of the lock_write. ``repository.RepositoryWriteLockResult``
and ``branch.BranchWriteLockResult`` document this. (Robert Collins)

``log._get_info_for_log_files`` now takes an add_cleanup callable.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
 
from . import _get_bundle_header
20
 
from .v08 import BundleSerializerV08, BundleReader
21
 
from ..bundle_data import BundleInfo
22
 
 
23
 
from ...testament import StrictTestament3
 
17
from bzrlib.bundle.serializer import _get_bundle_header
 
18
from bzrlib.bundle.serializer.v08 import BundleSerializerV08, BundleReader
 
19
from bzrlib.testament import StrictTestament3
 
20
from bzrlib.bundle.bundle_data import BundleInfo
24
21
 
25
22
 
26
23
"""Serializer for bundle format 0.9"""
41
38
    def _write_main_header(self):
42
39
        """Write the header for the changes"""
43
40
        f = self.to_file
44
 
        f.write(_get_bundle_header('0.9') + b'#\n')
 
41
        f.write(_get_bundle_header('0.9') + '#\n')
45
42
 
46
43
    def _testament_sha1(self, revision_id):
47
44
        return StrictTestament3.from_revision(self.source,
66
63
        testament = StrictTestament3.from_revision(repository, revision_id)
67
64
        return testament.as_sha1()
68
65
 
69
 
    def _testament(self, revision, tree):
70
 
        return StrictTestament3(revision, tree)
 
66
    def _testament_sha1(self, revision, inventory):
 
67
        return StrictTestament3(revision, inventory).as_sha1()
71
68
 
72
69
 
73
70
class BundleReaderV09(BundleReader):