remotefilelog: disable descendantrevfastpath by default

Summary:
With treemanifest and the eden api, descendantrevfastpath (which downloads all
the manifests) is slower than just downloading the history from the eden api.

We still want to record the descendantrev if we already know the real linkrev
of the current filenode, as that will still be fast.

Reviewed By: quark-zju

Differential Revision: D15943076

fbshipit-source-id: c6013801822bdfa3196e60cbcd34a9ce184c5c5f
This commit is contained in:
Mark Thomas 2019-07-10 16:37:21 -07:00 committed by Facebook Github Bot
parent 5f2b5fbeb6
commit 398067390d
3 changed files with 7 additions and 6 deletions

View File

@ -246,6 +246,7 @@ command = registrar.command(cmdtable)
configtable = {}
configitem = registrar.configitem(configtable)
configitem("remotefilelog", "descendantrevfastpath", default=False)
configitem("remotefilelog", "fetchpacks", default=False)
configitem("remotefilelog", "localdatarepack", default=False)
configitem("remotefilelog", "packlocaldata", default=False)

View File

@ -71,7 +71,7 @@ class remotefilectx(context.filectx):
)
self._ancestormap = ancestormap
self._descendantrevfastpath = repo.ui.configbool(
"remotefilelog", "descendantrevfastpath", True
"remotefilelog", "descendantrevfastpath"
)
def size(self):
@ -215,7 +215,7 @@ class remotefilectx(context.filectx):
p1ctx = remotefilectx(
repo, path, fileid=p1, filelog=flog, ancestormap=ancestormap
)
if self._descendantrevfastpath:
if self._descendantrevfastpath or "_changeid" in self.__dict__:
p1ctx._descendantrev = self.rev()
results.append(p1ctx)
@ -225,7 +225,7 @@ class remotefilectx(context.filectx):
p2ctx = remotefilectx(
repo, path, fileid=p2, filelog=flog, ancestormap=ancestormap
)
if self._descendantrevfastpath:
if self._descendantrevfastpath or "_changeid" in self.__dict__:
p2ctx._descendantrev = self.rev()
results.append(p2ctx)
@ -589,7 +589,7 @@ class remoteworkingfilectx(context.workingfilectx, remotefilectx):
def __init__(self, repo, path, filelog=None, workingctx=None):
self._ancestormap = None
self._descendantrevfastpath = repo.ui.configbool(
"remotefilelog", "descendantrevfastpath", True
"remotefilelog", "descendantrevfastpath"
)
return super(remoteworkingfilectx, self).__init__(
repo, path, filelog, workingctx

View File

@ -117,10 +117,10 @@ Rename the file in a commit
11 trees fetched over *s (glob)
* files fetched over *s (glob)
Amend the commit to add a new file with an empty cache
Amend the commit to add a new file with an empty cache, with descendantrevfastpath enabled
$ clearcache
$ echo more >> a/b/c/d/e/f/g/h/i/j/file3
$ hg amend -A --config remotefilelog.debug=True
$ hg amend -A --config remotefilelog.debug=True --config remotefilelog.descendantrevfastpath=True
adding a/b/c/d/e/f/g/h/i/j/file3
fetching tree '' efa8fa4352b919302f90e85924e691a632d6bea0, found via 9f95b8f1011f
11 trees fetched over *s (glob)