equal
deleted
inserted
replaced
35 cmdutil, |
35 cmdutil, |
36 commands, |
36 commands, |
37 copies, |
37 copies, |
38 error, |
38 error, |
39 extensions, |
39 extensions, |
|
40 hg, |
40 mdiff, |
41 mdiff, |
41 merge, |
42 merge, |
42 revlog, |
43 revlog, |
43 util, |
44 util, |
44 ) |
45 ) |
65 pass |
66 pass |
66 try: |
67 try: |
67 from mercurial import scmutil # since 1.9 (or 8b252e826c68) |
68 from mercurial import scmutil # since 1.9 (or 8b252e826c68) |
68 except ImportError: |
69 except ImportError: |
69 pass |
70 pass |
|
71 try: |
|
72 from mercurial import setdiscovery # since 1.9 (or cb98fed52495) |
|
73 except ImportError: |
|
74 pass |
|
75 |
70 |
76 |
71 def identity(a): |
77 def identity(a): |
72 return a |
78 return a |
73 |
79 |
74 try: |
80 try: |
579 for rev in revs: |
585 for rev in revs: |
580 rev in s |
586 rev in s |
581 timer(d) |
587 timer(d) |
582 fm.end() |
588 fm.end() |
583 |
589 |
|
590 @command(b'perfdiscovery', formatteropts, b'PATH') |
|
591 def perfdiscovery(ui, repo, path, **opts): |
|
592 """benchmark discovery between local repo and the peer at given path |
|
593 """ |
|
594 repos = [repo, None] |
|
595 timer, fm = gettimer(ui, opts) |
|
596 path = ui.expandpath(path) |
|
597 |
|
598 def s(): |
|
599 repos[1] = hg.peer(ui, opts, path) |
|
600 def d(): |
|
601 setdiscovery.findcommonheads(ui, *repos) |
|
602 timer(d, setup=s) |
|
603 fm.end() |
|
604 |
584 @command(b'perfbookmarks', formatteropts + |
605 @command(b'perfbookmarks', formatteropts + |
585 [ |
606 [ |
586 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'), |
607 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'), |
587 ]) |
608 ]) |
588 def perfbookmarks(ui, repo, **opts): |
609 def perfbookmarks(ui, repo, **opts): |