# HG changeset patch # User Anton Shestakov # Date 2018-10-05 15:40:12 # Node ID 4ab6e7b4fe8ac60873b4eeb3d26a5efd0e38b204 # Parent 0ac794e0e285cd02bcb8576d0ae30f092abf91e0 streamclone: abort when client needs to handle obsmarkers, but doesn't When client doesn't have any of obsolescence markers exchange capabilities, then it's safe to say it can't handle obsmarkers. However, if it understands even one format version, then stream clones are fine -- client can use "obsmarkers" bundle2 part. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1700,7 +1700,10 @@ def addpartbundlestream2(bundler, repo, includeobsmarkers = False if repo.obsstore: remoteversions = obsmarkersversion(bundler.capabilities) - if repo.obsstore._version in remoteversions: + if not remoteversions: + raise error.Abort(_('server has obsolescence markers, but client ' + 'cannot receive them via stream clone')) + elif repo.obsstore._version in remoteversions: includeobsmarkers = True filecount, bytecount, it = streamclone.generatev2(repo, includepats, diff --git a/tests/test-clone-uncompressed.t b/tests/test-clone-uncompressed.t --- a/tests/test-clone-uncompressed.t +++ b/tests/test-clone-uncompressed.t @@ -556,6 +556,12 @@ Clone non-publishing with obsolescence $ hg debugobsolete -R with-obsolescence 50382b884f66690b7045cac93a540cba4d4c906f 0 {c17445101a72edac06facd130d14808dfbd5c7c2} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} + $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution + streaming all changes + remote: abort: server has obsolescence markers, but client cannot receive them via stream clone + abort: pull failed on remote + [255] + $ killdaemons.py #endif