/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-31 05:37:51 UTC
  • mfrom: (6754.8.15 lock-context)
  • Revision ID: jelmer@jelmer.uk-20170831053751-9pem67h9hu2p8lg2
Merge lp:~jelmer/brz/lock-context.

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))