/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/plugins/launchpad/lp_api_lite.py

  • Committer: Jelmer Vernooij
  • Date: 2017-08-29 21:29:35 UTC
  • mfrom: (6754.8.21 lock-context-2)
  • mto: This revision was merged to the branch mainline in revision 6784.
  • Revision ID: jelmer@jelmer.uk-20170829212935-lakl2jhq9sqckejp
Merge lock-context-2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
    #       it should be valid for the package importer branches that we care
196
196
    #       about
197
197
    reverse_dict = dict((rev, tag) for tag, rev in tag_dict.items())
198
 
    the_branch.lock_read()
199
 
    try:
 
198
    with the_branch.lock_read():
200
199
        last_rev = the_branch.last_revision()
201
200
        graph = the_branch.repository.get_graph()
202
201
        stop_revisions = (None, revision.NULL_REVISION)
203
202
        for rev_id in graph.iter_lefthand_ancestry(last_rev, stop_revisions):
204
203
            if rev_id in reverse_dict:
205
204
                return reverse_dict[rev_id]
206
 
    finally:
207
 
        the_branch.unlock()
208
205
 
209
206
 
210
207
def _get_newest_versions(the_branch, latest_pub):