Show More
@@ -791,9 +791,11 b' def debugdiscovery(ui, repo, remoteurl="' | |||||
791 | if not opts.get('nonheads'): |
|
791 | if not opts.get('nonheads'): | |
792 | ui.write(("unpruned common: %s\n") % |
|
792 | ui.write(("unpruned common: %s\n") % | |
793 | " ".join(sorted(short(n) for n in common))) |
|
793 | " ".join(sorted(short(n) for n in common))) | |
794 |
|
|
794 | cl = repo.changelog | |
|
795 | clnode = cl.node | |||
|
796 | dag = dagutil.revlogdag(cl) | |||
795 | all = dag.ancestorset(dag.internalizeall(common)) |
|
797 | all = dag.ancestorset(dag.internalizeall(common)) | |
796 |
common = d |
|
798 | common = {clnode(r) for r in dag.headsetofconnecteds(all)} | |
797 | else: |
|
799 | else: | |
798 | nodes = None |
|
800 | nodes = None | |
799 | if pushedrevs: |
|
801 | if pushedrevs: |
@@ -142,7 +142,9 b' def findcommonheads(ui, local, remote,' | |||||
142 |
|
142 | |||
143 | roundtrips = 0 |
|
143 | roundtrips = 0 | |
144 | cl = local.changelog |
|
144 | cl = local.changelog | |
|
145 | clnode = cl.node | |||
145 | localsubset = None |
|
146 | localsubset = None | |
|
147 | ||||
146 | if ancestorsof is not None: |
|
148 | if ancestorsof is not None: | |
147 | rev = local.changelog.rev |
|
149 | rev = local.changelog.rev | |
148 | localsubset = [rev(n) for n in ancestorsof] |
|
150 | localsubset = [rev(n) for n in ancestorsof] | |
@@ -159,7 +161,7 b' def findcommonheads(ui, local, remote,' | |||||
159 | with remote.commandexecutor() as e: |
|
161 | with remote.commandexecutor() as e: | |
160 | fheads = e.callcommand('heads', {}) |
|
162 | fheads = e.callcommand('heads', {}) | |
161 | fknown = e.callcommand('known', { |
|
163 | fknown = e.callcommand('known', { | |
162 |
'nodes': d |
|
164 | 'nodes': [clnode(r) for r in sample], | |
163 | }) |
|
165 | }) | |
164 |
|
166 | |||
165 | srvheadhashes, yesno = fheads.result(), fknown.result() |
|
167 | srvheadhashes, yesno = fheads.result(), fknown.result() | |
@@ -176,12 +178,12 b' def findcommonheads(ui, local, remote,' | |||||
176 | srvheads = dag.internalizeall(srvheadhashes, filterunknown=True) |
|
178 | srvheads = dag.internalizeall(srvheadhashes, filterunknown=True) | |
177 | if len(srvheads) == len(srvheadhashes): |
|
179 | if len(srvheads) == len(srvheadhashes): | |
178 | ui.debug("all remote heads known locally\n") |
|
180 | ui.debug("all remote heads known locally\n") | |
179 |
return |
|
181 | return srvheadhashes, False, srvheadhashes | |
180 |
|
182 | |||
181 | if len(sample) == len(ownheads) and all(yesno): |
|
183 | if len(sample) == len(ownheads) and all(yesno): | |
182 | ui.note(_("all local heads known remotely\n")) |
|
184 | ui.note(_("all local heads known remotely\n")) | |
183 |
ownheadhashes = d |
|
185 | ownheadhashes = [clnode(r) for r in ownheads] | |
184 |
return |
|
186 | return ownheadhashes, True, srvheadhashes | |
185 |
|
187 | |||
186 | # full blown discovery |
|
188 | # full blown discovery | |
187 |
|
189 | |||
@@ -235,7 +237,7 b' def findcommonheads(ui, local, remote,' | |||||
235 |
|
237 | |||
236 | with remote.commandexecutor() as e: |
|
238 | with remote.commandexecutor() as e: | |
237 | yesno = e.callcommand('known', { |
|
239 | yesno = e.callcommand('known', { | |
238 |
'nodes': d |
|
240 | 'nodes': [clnode(r) for r in sample], | |
239 | }).result() |
|
241 | }).result() | |
240 |
|
242 | |||
241 | full = True |
|
243 | full = True | |
@@ -268,4 +270,5 b' def findcommonheads(ui, local, remote,' | |||||
268 | return ({nullid}, True, srvheadhashes,) |
|
270 | return ({nullid}, True, srvheadhashes,) | |
269 |
|
271 | |||
270 | anyincoming = (srvheadhashes != [nullid]) |
|
272 | anyincoming = (srvheadhashes != [nullid]) | |
271 | return dag.externalizeall(result), anyincoming, srvheadhashes |
|
273 | result = {clnode(r) for r in result} | |
|
274 | return result, anyincoming, srvheadhashes |
General Comments 0
You need to be logged in to leave comments.
Login now