Default master-fastpath to True

Summary:
## Context
See D33771940 (d274a0f575)

## This diff
I move `pull.master-fastpath` to True.

Reviewed By: quark-zju

Differential Revision: D33892184

fbshipit-source-id: 105c587da85287915ce3963315d568bf65b798c9
This commit is contained in:
Yan Soares Couto 2022-02-02 11:00:13 -08:00 committed by Facebook GitHub Bot
parent 43341dab14
commit 80517b6fda
7 changed files with 70 additions and 14 deletions

View File

@ -6,8 +6,7 @@
$ . "${TEST_FIXTURES}/library.sh"
$ configure modern
$ setconfig pull.master-fastpath=1 \
> remotenames.selectivepulldefault=master_bookmark \
$ setconfig remotenames.selectivepulldefault=master_bookmark \
> pull.httpcommitgraph=1 pull.httphashprefix=1
Set up local hgrc and Mononoke config, with http pull

View File

@ -438,6 +438,7 @@ coreconfigitem("pull", "httpbookmarks", default=True)
coreconfigitem("pull", "httphashprefix", default=False)
coreconfigitem("pull", "httpcommitgraph", default=False)
coreconfigitem("pull", "httpmutation", default=True)
coreconfigitem("pull", "master-fastpath", default=True)
coreconfigitem("exchange", "httpcommitlookup", default=True)
coreconfigitem("push", "pushvars.server", default=True)
coreconfigitem("push", "requirereason", default=False)

View File

@ -1,12 +1,13 @@
#chg-compatible
$ setconfig experimental.allowfilepeer=True
$ enable amend commitcloud infinitepush rebase remotenames pullcreatemarkers
$ enable amend commitcloud infinitepush rebase remotenames pullcreatemarkers phabstatus
$ configure dummyssh
$ setconfig commitcloud.hostname=testhost
$ setconfig remotefilelog.reponame=server
$ setconfig pullcreatemarkers.use-graphql=false
$ setconfig pullcreatemarkers.hook-pull=true
$ setconfig extensions.arcconfig="$TESTDIR/../edenscm/hgext/extlib/phabricator/arcconfig.py"
$ hg init server --config extensions.treemanifest=$TESTDIR/../edenscm/hgext/treemanifestserver.py
$ cd server
@ -18,7 +19,11 @@
$ hg bookmark master
$ hg debugmakepublic .
$ cd ..
Configure arc
$ echo '{}' > .arcrc
$ echo '{"config" : {"default" : "https://a.com/api"}, "hosts" : {"https://a.com/api/" : { "user" : "testuser", "oauth" : "garbage_cert"}}}' > .arcconfig
Client 1
$ hg clone ssh://user@dummy/server client1 -q
$ cd client1
$ setconfig commitcloud.servicetype=local commitcloud.servicelocation=$TESTTMP commitcloud.token_enforced=False
@ -66,15 +71,46 @@ Fake land the commit
$ echo 2 > serverfile
$ hg commit -Aqm public-commit-2
$ hg debugmakepublic .
$ cat > $TESTTMP/mockduit << EOF
> [{
> "data": {
> "phabricator_diff_query": [
> {
> "results": {
> "nodes": [
> {
> "number": 1234,
> "phabricator_versions": {
> "nodes": [
> {"local_commits": []}
> ]
> },
> "phabricator_diff_commit": {
> "nodes": [
> {"commit_identifier": "441f69264760bc9126522b19ffd4ad350cb79a29"}
> ]
> }
> }
> ]
> }
> }
> ]
> },
> "extensions": {
> "is_final": true
> }
> }]
> EOF
$ cd ..
$ cd client1
$ hg pull
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg pull
pulling from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
marked 1 commit as landed
$ tglogp
o 67d363c9001e public 'public-commit-2'
@ -132,7 +168,7 @@ Sync in client2. This will omit the bookmark because we don't have the landed
Pull so that we have the public commit and sync again.
$ hg pull
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg pull
pulling from ssh://user@dummy/server
searching for changes
adding changesets

View File

@ -51,7 +51,7 @@ Pull:
$ setconfig paths.default=test:e2
$ LOG=pull::fastpath=debug hg pull --config pull.master-fastpath=True
$ LOG=pull::fastpath=debug hg pull
pulling from test:e2
DEBUG pull::fastpath: master: 26805aba1e600a82e93661149f2313866a221a7b => 9bc730a19041f9ec7cb33c626e811aa233efb18c
imported commit graph for 2 commits (1 segment)
@ -67,7 +67,7 @@ Pull:
o A
(pull again does not trigger pull fast path API)
$ LOG=pull::fastpath=debug hg pull --config pull.master-fastpath=True
$ LOG=pull::fastpath=debug hg pull
pulling from test:e2
DEBUG pull::fastpath: master: 9bc730a19041f9ec7cb33c626e811aa233efb18c (unchanged)
@ -95,7 +95,7 @@ Test fallback to slow path:
> |
> A
> EOS
$ LOG=pull::fastpath=debug hg pull --config pull.master-fastpath=True
$ LOG=pull::fastpath=debug hg pull
pulling from test:e2
DEBUG pull::fastpath: master: 26805aba1e600a82e93661149f2313866a221a7b => 9bc730a19041f9ec7cb33c626e811aa233efb18c
WARN pull::fastpath: cannot use pull fast path: NeedSlowPath: f585351a92f85104bff7c284233c338b10eb1df7 exists in local graph
@ -121,7 +121,7 @@ Test DAG flushed but not metalog (Emulates Ctrl+C or SIGKILL in between):
pulling from test:e1
$ setconfig paths.default=test:e2
$ FAILPOINTS=transaction-metalog-commit=return LOG=pull::fastpath=debug hg pull --config pull.master-fastpath=True
$ FAILPOINTS=transaction-metalog-commit=return LOG=pull::fastpath=debug hg pull
pulling from test:e2
DEBUG pull::fastpath: master: 26805aba1e600a82e93661149f2313866a221a7b => 9bc730a19041f9ec7cb33c626e811aa233efb18c
imported commit graph for 2 commits (1 segment)
@ -133,7 +133,7 @@ Test DAG flushed but not metalog (Emulates Ctrl+C or SIGKILL in between):
Fast path can still be used with stale remotenames:
$ setconfig paths.default=test:e3
$ LOG=pull::fastpath=debug,dag::protocol=debug hg pull --config pull.master-fastpath=True
$ LOG=pull::fastpath=debug,dag::protocol=debug hg pull
pulling from test:e3
DEBUG pull::fastpath: master: 9bc730a19041f9ec7cb33c626e811aa233efb18c => 7b3a68e117f183a6da8e60779d8fbeeed22382bb
DEBUG dag::protocol: resolve names [9d37022187178c68e8fe8dff17c9c57fb62b9ea5, a194cadd16930608adaa649035ad4c16930cbd0f] remotely

View File

@ -75,6 +75,7 @@ C and E are known and F is unknown
$ hg pull -r 99dac869f01e09
pulling from test:e1
DEBUG pull::httpbookmarks: edenapi fetched bookmarks: {'master': '178c10ffbc2f92d5407c14478ae9d9dea81f232e'}
DEBUG pull::fastpath: master: 178c10ffbc2f92d5407c14478ae9d9dea81f232e (unchanged)
DEBUG pull::httphashlookup: edenapi hash lookups: ['99dac869f01e09fe3d501fa645ea524af80d498f']
DEBUG exchange::httpcommitlookup: edenapi commitknown: {'hgid': b'\x17\x8c\x10\xff\xbc/\x92\xd5@|\x14G\x8a\xe9\xd9\xde\xa8\x1f#.', 'known': {'Ok': True}}
DEBUG exchange::httpcommitlookup: edenapi commitknown: {'hgid': b"/'FJf\xa0\x1c\x1c\x14\xaa%yN\xf4\x10Q\x8d\xc0\x17\xaf", 'known': {'Ok': False}}

View File

@ -2,12 +2,13 @@
Setup
$ configure mutation-norecord dummyssh
$ configure mutation-norecord dummyssh phabstatus
$ enable amend pullcreatemarkers pushrebase rebase remotenames
$ setconfig ui.username="nobody <no.reply@fb.com>" experimental.rebaseskipobsolete=true
$ setconfig remotenames.allownonfastforward=true
$ setconfig pullcreatemarkers.use-graphql=false
$ setconfig pullcreatemarkers.hook-pull=true
$ setconfig extensions.arcconfig="$TESTDIR/../edenscm/hgext/extlib/phabricator/arcconfig.py"
Test that hg pull creates obsolescence markers for landed diffs
$ hg init server
@ -24,6 +25,11 @@ Test that hg pull creates obsolescence markers for landed diffs
> echo "Reviewed By: someone" >> msg
> hg ci --amend -l msg
> }
$ landed_graphql() {
> printf '{"number": %s, ' $1
> printf '"phabricator_versions": { "nodes": [] }, "phabricator_diff_commit": '
> printf '{ "nodes": [{"commit_identifier": "%s"}]}}' $2
> }
Set up server repository
@ -33,6 +39,10 @@ Set up server repository
$ hg book master
$ cd ..
Configure arc
$ echo '{}' > .arcrc
$ echo '{"config" : {"default" : "https://a.com/api"}, "hosts" : {"https://a.com/api/" : { "user" : "testuser", "oauth" : "garbage_cert"}}}' > .arcconfig
Set up a client repository, and work on 3 diffs
$ hg clone ssh://user@dummy/server client -q
@ -73,6 +83,9 @@ when a diff is landed with landcastle.
remote: pushing 2 changesets:
remote: e0672eeeb97c add b
remote: cc68f5e5f8d6 add c
$ printf '[{"data": {"phabricator_diff_query": [{"results": {"nodes": [%s, %s]}}]}}]' \
> "$(landed_graphql 123 e0672eeeb97c5767cc642e702951cfcfa73cdc82)" \
> "$(landed_graphql 124 cc68f5e5f8d6a0aa5683ff6fb1afd15aa95a08b8)" > $TESTTMP/mockduit
Strip the commits we just landed.
@ -83,12 +96,13 @@ Strip the commits we just landed.
Here pull should now detect commits 2 and 3 as landed, but it won't be able to
hide them since there is a non-hidden successor.
$ hg pull
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg pull
pulling from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
marked 2 commits as landed
$ hg log -G -T '"{desc}" {remotebookmarks}' -r 'all()'
o "add c
@ -129,6 +143,10 @@ Now land the last diff.
updating bookmark master
remote: pushing 1 changeset:
remote: 296f9d37d5c1 add d
$ printf '[{"data": {"phabricator_diff_query": [{"results": {"nodes": [%s, %s, %s]}}]}}]' \
> "$(landed_graphql 123 e0672eeeb97c5767cc642e702951cfcfa73cdc82)" \
> "$(landed_graphql 124 cc68f5e5f8d6a0aa5683ff6fb1afd15aa95a08b8)" \
> "$(landed_graphql 131 296f9d37d5c114b8e03228a16e0fb390dcc1dca8)" > $TESTTMP/mockduit
And strip the commit we just landed.
@ -140,12 +158,13 @@ Here pull should now detect commit 4 has been landed. It should hide this
commit, and should also hide 3 and 2, which were previously landed, but up
until now had non-hidden successors.
$ hg pull
$ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg pull
pulling from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
marked 1 commit as landed
$ hg log -G -T '"{desc}" {remotebookmarks}' -r 'all()'
o "add d

View File

@ -9,7 +9,7 @@ And the client does not limit itself to only be able to resolve ancestors of
the old master in that case.
$ configure modern
$ setconfig paths.default=test:e1 ui.ssh=false pull.master-fastpath=true
$ setconfig paths.default=test:e1 ui.ssh=false
$ shorttraceback
Reduce discovery sample size so we avoid triggering resolving lazy hashes to expose issues.