~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fetch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-14 12:49:33 UTC
  • mto: This revision was merged to the branch mainline in revision 6216.
  • Revision ID: jelmer@samba.org-20111014124933-732wmdc39ebzga0b
Fix last locking issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
 
40
40
def revision_history(branch):
41
 
    graph = branch.repository.get_graph()
42
 
    history = list(graph.iter_lefthand_ancestry(branch.last_revision(),
43
 
        [_mod_revision.NULL_REVISION]))
 
41
    branch.lock_read()
 
42
    try:
 
43
        graph = branch.repository.get_graph()
 
44
        history = list(graph.iter_lefthand_ancestry(branch.last_revision(),
 
45
            [_mod_revision.NULL_REVISION]))
 
46
    finally:
 
47
        branch.unlock()
44
48
    history.reverse()
45
49
    return history
46
50