/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 tools/time_graph.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:
29
29
    b = branch.Branch.open(args[0])
30
30
else:
31
31
    b = branch.Branch.open('.')
32
 
b.lock_read()
33
 
try:
 
32
with b.lock_read():
34
33
    g = b.repository.get_graph()
35
34
    parent_map = dict(p for p in g.iter_ancestry([b.last_revision()])
36
35
                         if p[1] is not None)
37
 
finally:
38
 
    b.unlock()
39
36
end = time.clock()
40
37
 
41
38
print('Found %d nodes, loaded in %.3fs' % (len(parent_map), end - begin))