/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 tests/test_git_remote_helper.py

Use context managers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
def map_to_git_sha1(dir, bzr_revid):
40
40
    object_store = get_object_store(dir.open_repository())
41
 
    object_store.lock_read()
42
 
    try:
 
41
    with object_store.lock_read():
43
42
        return object_store._lookup_revision_sha1(bzr_revid)
44
 
    finally:
45
 
        object_store.unlock()
46
43
 
47
44
 
48
45
class OpenLocalDirTests(TestCaseWithTransport):