1087 ) |
1088 ) |
1088 return common, hds |
1089 return common, hds |
1089 |
1090 |
1090 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) |
1091 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) |
1091 localrevs = opts[b'rev'] |
1092 localrevs = opts[b'rev'] |
1092 with util.timedcm('debug-discovery') as t: |
1093 |
1093 common, hds = doit(localrevs, remoterevs) |
1094 fm = ui.formatter(b'debugdiscovery', opts) |
|
1095 if fm.strict_format: |
|
1096 |
|
1097 @contextlib.contextmanager |
|
1098 def may_capture_output(): |
|
1099 ui.pushbuffer() |
|
1100 yield |
|
1101 data[b'output'] = ui.popbuffer() |
|
1102 |
|
1103 else: |
|
1104 may_capture_output = util.nullcontextmanager |
|
1105 with may_capture_output(): |
|
1106 with util.timedcm('debug-discovery') as t: |
|
1107 common, hds = doit(localrevs, remoterevs) |
1094 |
1108 |
1095 # compute all statistics |
1109 # compute all statistics |
1096 heads_common = set(common) |
1110 heads_common = set(common) |
1097 heads_remote = set(hds) |
1111 heads_remote = set(hds) |
1098 heads_local = set(repo.heads()) |
1112 heads_local = set(repo.heads()) |
1139 data[b'nb-ini_und-heads'] = len(heads_initial_undecided) |
1153 data[b'nb-ini_und-heads'] = len(heads_initial_undecided) |
1140 data[b'nb-ini_und-roots'] = len(roots_initial_undecided) |
1154 data[b'nb-ini_und-roots'] = len(roots_initial_undecided) |
1141 data[b'nb-ini_und-common'] = len(common_initial_undecided) |
1155 data[b'nb-ini_und-common'] = len(common_initial_undecided) |
1142 data[b'nb-ini_und-missing'] = len(missing_initial_undecided) |
1156 data[b'nb-ini_und-missing'] = len(missing_initial_undecided) |
1143 |
1157 |
1144 fm = ui.formatter(b'debugdiscovery', opts) |
|
1145 fm.startitem() |
1158 fm.startitem() |
1146 fm.data(**pycompat.strkwargs(data)) |
1159 fm.data(**pycompat.strkwargs(data)) |
1147 # display discovery summary |
1160 # display discovery summary |
1148 fm.plain(b"elapsed time: %(elapsed)f seconds\n" % data) |
1161 fm.plain(b"elapsed time: %(elapsed)f seconds\n" % data) |
1149 fm.plain(b"round-trips: %(total-roundtrips)9d\n" % data) |
1162 fm.plain(b"round-trips: %(total-roundtrips)9d\n" % data) |