diff --git a/hgsql.py b/hgsql.py index acff4d07af..f5072514bf 100644 --- a/hgsql.py +++ b/hgsql.py @@ -34,7 +34,9 @@ INITIAL_SYNC_FORCE = 'force' initialsync = INITIAL_SYNC_NORMAL cls = localrepo.localrepository -for reqs in ['supportedformats', 'openerreqs', '_basesupported']: +# Do NOT add hgsql to localrepository.supportedformats. Doing that breaks +# streaming clones. +for reqs in ['openerreqs', '_basesupported']: getattr(cls, reqs).add('hgsql') def newreporequirements(orig, repo): diff --git a/tests/test-requires.t b/tests/test-requires.t index 28d8a21384..b1f252f6d0 100644 --- a/tests/test-requires.t +++ b/tests/test-requires.t @@ -14,6 +14,8 @@ $ hg pull -q ../client Test that hgsql is a requirement + $ grep hgsql .hg/requires + hgsql $ hg log -r tip --config extensions.hgsql=! abort: repository requires features unknown to this Mercurial: hgsql! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) @@ -25,3 +27,9 @@ Test that hgsql is a requirement date: Thu Jan 01 00:00:00 1970 +0000 summary: x + +Ensure streaming clones to non-hgsql repos work + $ cd .. + $ hg clone --config extensions.hgsql=! --config ui.ssh='python "$TESTDIR/dummyssh"' --uncompressed ssh://user@dummy/master client2 | grep "streaming all changes" + streaming all changes +