##// END OF EJS Templates
setdiscovery: don't use dagutil for rev -> node conversions...
Gregory Szorc -
r39195:5b32b3c6 default
parent child Browse files
Show More
@@ -791,9 +791,11 b' def debugdiscovery(ui, repo, remoteurl="'
791 791 if not opts.get('nonheads'):
792 792 ui.write(("unpruned common: %s\n") %
793 793 " ".join(sorted(short(n) for n in common)))
794 dag = dagutil.revlogdag(repo.changelog)
794 cl = repo.changelog
795 clnode = cl.node
796 dag = dagutil.revlogdag(cl)
795 797 all = dag.ancestorset(dag.internalizeall(common))
796 common = dag.externalizeall(dag.headsetofconnecteds(all))
798 common = {clnode(r) for r in dag.headsetofconnecteds(all)}
797 799 else:
798 800 nodes = None
799 801 if pushedrevs:
@@ -142,7 +142,9 b' def findcommonheads(ui, local, remote,'
142 142
143 143 roundtrips = 0
144 144 cl = local.changelog
145 clnode = cl.node
145 146 localsubset = None
147
146 148 if ancestorsof is not None:
147 149 rev = local.changelog.rev
148 150 localsubset = [rev(n) for n in ancestorsof]
@@ -159,7 +161,7 b' def findcommonheads(ui, local, remote,'
159 161 with remote.commandexecutor() as e:
160 162 fheads = e.callcommand('heads', {})
161 163 fknown = e.callcommand('known', {
162 'nodes': dag.externalizeall(sample),
164 'nodes': [clnode(r) for r in sample],
163 165 })
164 166
165 167 srvheadhashes, yesno = fheads.result(), fknown.result()
@@ -176,12 +178,12 b' def findcommonheads(ui, local, remote,'
176 178 srvheads = dag.internalizeall(srvheadhashes, filterunknown=True)
177 179 if len(srvheads) == len(srvheadhashes):
178 180 ui.debug("all remote heads known locally\n")
179 return (srvheadhashes, False, srvheadhashes,)
181 return srvheadhashes, False, srvheadhashes
180 182
181 183 if len(sample) == len(ownheads) and all(yesno):
182 184 ui.note(_("all local heads known remotely\n"))
183 ownheadhashes = dag.externalizeall(ownheads)
184 return (ownheadhashes, True, srvheadhashes,)
185 ownheadhashes = [clnode(r) for r in ownheads]
186 return ownheadhashes, True, srvheadhashes
185 187
186 188 # full blown discovery
187 189
@@ -235,7 +237,7 b' def findcommonheads(ui, local, remote,'
235 237
236 238 with remote.commandexecutor() as e:
237 239 yesno = e.callcommand('known', {
238 'nodes': dag.externalizeall(sample),
240 'nodes': [clnode(r) for r in sample],
239 241 }).result()
240 242
241 243 full = True
@@ -268,4 +270,5 b' def findcommonheads(ui, local, remote,'
268 270 return ({nullid}, True, srvheadhashes,)
269 271
270 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