~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to graph.py

  • Committer: Aaron Bentley
  • Date: 2005-10-28 03:16:25 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20051028031625-aad040bd7217a4fa
Added locking to graph-ancestry

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
        m = Branch.open_containing(merge_branch)[0]
222
222
    else:
223
223
        m = None
224
 
    grapher = Grapher(b, m)
225
 
    relations = grapher.get_relations(collapse)
 
224
    b.lock_read()
 
225
    try:
 
226
        if m is not None:
 
227
            m.lock_read()
 
228
        try:
 
229
            grapher = Grapher(b, m)
 
230
            relations = grapher.get_relations(collapse)
 
231
        finally:
 
232
            if m is not None:
 
233
                m.unlock()
 
234
    finally:
 
235
        b.unlock()
226
236
 
227
237
    ext = filename.split('.')[-1]
228
238
    output = dot_output(relations, ranking)