Show More
@@ -791,6 +791,63 b' def perfphases(ui, repo, **opts):' | |||||
791 | timer(d) |
|
791 | timer(d) | |
792 | fm.end() |
|
792 | fm.end() | |
793 |
|
793 | |||
|
794 | @command('perfphasesremote', | |||
|
795 | [], "[DEST]") | |||
|
796 | def perfphasesremote(ui, repo, dest=None, **opts): | |||
|
797 | """benchmark time needed to analyse phases of the remote server""" | |||
|
798 | from mercurial.node import ( | |||
|
799 | bin, | |||
|
800 | ) | |||
|
801 | from mercurial import ( | |||
|
802 | exchange, | |||
|
803 | hg, | |||
|
804 | phases, | |||
|
805 | ) | |||
|
806 | timer, fm = gettimer(ui, opts) | |||
|
807 | ||||
|
808 | path = ui.paths.getpath(dest, default=('default-push', 'default')) | |||
|
809 | if not path: | |||
|
810 | raise error.abort(('default repository not configured!'), | |||
|
811 | hint=("see 'hg help config.paths'")) | |||
|
812 | dest = path.pushloc or path.loc | |||
|
813 | branches = (path.branch, opts.get('branch') or []) | |||
|
814 | ui.status(('analysing phase of %s\n') % util.hidepassword(dest)) | |||
|
815 | revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) | |||
|
816 | other = hg.peer(repo, opts, dest) | |||
|
817 | ||||
|
818 | # easier to perform discovery through the operation | |||
|
819 | op = exchange.pushoperation(repo, other) | |||
|
820 | exchange._pushdiscoverychangeset(op) | |||
|
821 | ||||
|
822 | remotesubset = op.fallbackheads | |||
|
823 | ||||
|
824 | with other.commandexecutor() as e: | |||
|
825 | remotephases = e.callcommand('listkeys', | |||
|
826 | {'namespace': 'phases'}).result() | |||
|
827 | del other | |||
|
828 | publishing = remotephases.get('publishing', False) | |||
|
829 | if publishing: | |||
|
830 | ui.status(('publishing: yes\n')) | |||
|
831 | else: | |||
|
832 | ui.status(('publishing: no\n')) | |||
|
833 | ||||
|
834 | nodemap = repo.changelog.nodemap | |||
|
835 | nonpublishroots = 0 | |||
|
836 | for nhex, phase in remotephases.iteritems(): | |||
|
837 | if nhex == 'publishing': # ignore data related to publish option | |||
|
838 | continue | |||
|
839 | node = bin(nhex) | |||
|
840 | if node in nodemap and int(phase): | |||
|
841 | nonpublishroots += 1 | |||
|
842 | ui.status(('number of roots: %d\n') % len(remotephases)) | |||
|
843 | ui.status(('number of known non public roots: %d\n') % nonpublishroots) | |||
|
844 | def d(): | |||
|
845 | phases.remotephasessummary(repo, | |||
|
846 | remotesubset, | |||
|
847 | remotephases) | |||
|
848 | timer(d) | |||
|
849 | fm.end() | |||
|
850 | ||||
794 | @command('perfmanifest', [], 'REV') |
|
851 | @command('perfmanifest', [], 'REV') | |
795 | def perfmanifest(ui, repo, rev, **opts): |
|
852 | def perfmanifest(ui, repo, rev, **opts): | |
796 | """benchmark the time to read a manifest from disk and return a usable |
|
853 | """benchmark the time to read a manifest from disk and return a usable |
@@ -99,6 +99,8 b' perfstatus' | |||||
99 | perfpathcopies |
|
99 | perfpathcopies | |
100 | (no help text available) |
|
100 | (no help text available) | |
101 | perfphases benchmark phasesets computation |
|
101 | perfphases benchmark phasesets computation | |
|
102 | perfphasesremote | |||
|
103 | benchmark time needed to analyse phases of the remote server | |||
102 | perfrawfiles (no help text available) |
|
104 | perfrawfiles (no help text available) | |
103 | perfrevlogchunks |
|
105 | perfrevlogchunks | |
104 | Benchmark operations on revlog chunks. |
|
106 | Benchmark operations on revlog chunks. | |
@@ -207,4 +209,7 b' Check perf.py for historical portability' | |||||
207 | contrib/perf.py:\d+: (re) |
|
209 | contrib/perf.py:\d+: (re) | |
208 | > from mercurial import ( |
|
210 | > from mercurial import ( | |
209 | import newer module separately in try clause for early Mercurial |
|
211 | import newer module separately in try clause for early Mercurial | |
|
212 | contrib/perf.py:\d+: (re) | |||
|
213 | > from mercurial import ( | |||
|
214 | import newer module separately in try clause for early Mercurial | |||
210 | [1] |
|
215 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now