/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: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python3
 
1
#!/usr/bin/env python
2
2
import random
3
3
import os
4
4
import time
8
8
    branch,
9
9
    commands,
10
10
    graph,
11
 
    osutils,
12
11
    ui,
13
12
    trace,
14
13
    _known_graph_py,
25
24
trace.enable_default_logging()
26
25
ui.ui_factory = text.TextUIFactory()
27
26
 
28
 
begin = osutils.perf_counter()
 
27
begin = time.clock()
29
28
if len(args) >= 1:
30
29
    b = branch.Branch.open(args[0])
31
30
else:
33
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
 
                      if p[1] is not None)
37
 
end = osutils.perf_counter()
 
35
                         if p[1] is not None)
 
36
end = time.clock()
38
37
 
39
38
print('Found %d nodes, loaded in %.3fs' % (len(parent_map), end - begin))
40
39
 
74
73
    graph._counters[1] = 0
75
74
    graph._counters[2] = 0
76
75
 
77
 
    begin = osutils.perf_counter()
 
76
    begin = time.clock()
78
77
    g = graph_klass(parent_map)
79
78
    if opts.lsprof is not None:
80
79
        heads = commands.apply_lsprofiled(opts.lsprof, all_heads_comp, g, comb)
81
80
    else:
82
81
        heads = all_heads_comp(g, comb)
83
 
    end = osutils.perf_counter()
 
82
    end = time.clock()
84
83
    return dict(elapsed=(end - begin), graph=g, heads=heads)
85
84
 
86
85
def report(name, g):