mercurial/setdiscovery.py
changeset 49017 f054a557aab8
parent 48946 642e31cb55f0
child 49647 c217d94cdd9d
equal deleted inserted replaced
49016:a2bd6b23881d 49017:f054a557aab8
   296     debug.
   296     debug.
   297     """
   297     """
   298 
   298 
   299     samplegrowth = float(ui.config(b'devel', b'discovery.grow-sample.rate'))
   299     samplegrowth = float(ui.config(b'devel', b'discovery.grow-sample.rate'))
   300 
   300 
       
   301     if audit is not None:
       
   302         audit[b'total-queries'] = 0
       
   303 
   301     start = util.timer()
   304     start = util.timer()
   302 
   305 
   303     roundtrips = 0
   306     roundtrips = 0
   304     cl = local.changelog
   307     cl = local.changelog
   305     clnode = cl.node
   308     clnode = cl.node
   374 
   377 
   375         ui.debug(b"query 1; heads\n")
   378         ui.debug(b"query 1; heads\n")
   376         roundtrips += 1
   379         roundtrips += 1
   377         with remote.commandexecutor() as e:
   380         with remote.commandexecutor() as e:
   378             fheads = e.callcommand(b'heads', {})
   381             fheads = e.callcommand(b'heads', {})
       
   382             if audit is not None:
       
   383                 audit[b'total-queries'] += len(sample)
   379             fknown = e.callcommand(
   384             fknown = e.callcommand(
   380                 b'known',
   385                 b'known',
   381                 {
   386                 {
   382                     b'nodes': [clnode(r) for r in sample],
   387                     b'nodes': [clnode(r) for r in sample],
   383                 },
   388                 },
   476 
   481 
   477         # indices between sample and externalized version must match
   482         # indices between sample and externalized version must match
   478         sample = list(sample)
   483         sample = list(sample)
   479 
   484 
   480         with remote.commandexecutor() as e:
   485         with remote.commandexecutor() as e:
       
   486             if audit is not None:
       
   487                 audit[b'total-queries'] += len(sample)
   481             yesno = e.callcommand(
   488             yesno = e.callcommand(
   482                 b'known',
   489                 b'known',
   483                 {
   490                 {
   484                     b'nodes': [clnode(r) for r in sample],
   491                     b'nodes': [clnode(r) for r in sample],
   485                 },
   492                 },