mercurial/setdiscovery.py
changeset 42354 dbd0fcca6dfc
parent 42170 6631f3e89b6f
child 42402 5b34972a0094
equal deleted inserted replaced
42353:f22131315791 42354:dbd0fcca6dfc
   254 
   254 
   255 def findcommonheads(ui, local, remote,
   255 def findcommonheads(ui, local, remote,
   256                     initialsamplesize=100,
   256                     initialsamplesize=100,
   257                     fullsamplesize=200,
   257                     fullsamplesize=200,
   258                     abortwhenunrelated=True,
   258                     abortwhenunrelated=True,
   259                     ancestorsof=None):
   259                     ancestorsof=None,
       
   260                     samplegrowth=1.05):
   260     '''Return a tuple (common, anyincoming, remoteheads) used to identify
   261     '''Return a tuple (common, anyincoming, remoteheads) used to identify
   261     missing nodes from or in remote.
   262     missing nodes from or in remote.
   262     '''
   263     '''
   263     start = util.timer()
   264     start = util.timer()
   264 
   265 
   387                 ui.note(_("sampling from both directions\n"))
   388                 ui.note(_("sampling from both directions\n"))
   388             else:
   389             else:
   389                 ui.debug("taking initial sample\n")
   390                 ui.debug("taking initial sample\n")
   390             samplefunc = disco.takefullsample
   391             samplefunc = disco.takefullsample
   391             targetsize = fullsamplesize
   392             targetsize = fullsamplesize
       
   393             if not remote.limitedarguments:
       
   394                 fullsamplesize = int(fullsamplesize * samplegrowth)
   392         else:
   395         else:
   393             # use even cheaper initial sample
   396             # use even cheaper initial sample
   394             ui.debug("taking quick initial sample\n")
   397             ui.debug("taking quick initial sample\n")
   395             samplefunc = disco.takequicksample
   398             samplefunc = disco.takequicksample
   396             targetsize = initialsamplesize
   399             targetsize = initialsamplesize