~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge updated set_parents api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        raise errors.BundleNotSupported(version, 'unknown bundle format')
92
92
 
93
93
    serializer = _serializers[version](version)
94
 
    return serializer.write(source, revision_ids, forced_bases, f) 
 
94
    source.lock_read()
 
95
    try:
 
96
        return serializer.write(source, revision_ids, forced_bases, f)
 
97
    finally:
 
98
        source.unlock()
95
99
 
96
100
 
97
101
def write_bundle(repository, revision_id, base_revision_id, out):
98
102
    """"""
 
103
    repository.lock_read()
 
104
    try:
 
105
        return _write_bundle(repository, revision_id, base_revision_id, out)
 
106
    finally:
 
107
        repository.unlock()
 
108
 
 
109
 
 
110
def _write_bundle(repository, revision_id, base_revision_id, out):
99
111
    if base_revision_id is NULL_REVISION:
100
112
        base_revision_id = None
101
113
    base_ancestry = set(repository.get_ancestry(base_revision_id))