/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: Jelmer Vernooij
  • Date: 2017-08-31 05:37:51 UTC
  • mfrom: (6754.8.15 lock-context)
  • Revision ID: jelmer@jelmer.uk-20170831053751-9pem67h9hu2p8lg2
Merge lp:~jelmer/brz/lock-context.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
    :param version: [optional] target serialization version
107
107
    """
108
108
 
109
 
    source.lock_read()
110
 
    try:
 
109
    with source.lock_read():
111
110
        return get_serializer(version).write(source, revision_ids,
112
111
                                             forced_bases, f)
113
 
    finally:
114
 
        source.unlock()
115
112
 
116
113
 
117
114
def write_bundle(repository, revision_id, base_revision_id, out, format=None):
123
120
         applying the bundle.
124
121
    :param out: Output file.
125
122
    """
126
 
    repository.lock_read()
127
 
    try:
 
123
    with repository.lock_read():
128
124
        return get_serializer(format).write_bundle(repository, revision_id,
129
125
                                                   base_revision_id, out)
130
 
    finally:
131
 
        repository.unlock()
132
126
 
133
127
 
134
128
class BundleSerializer(object):