Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bundle2.py @ 40399:4ab6e7b4fe8a
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.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 05 Oct 2018 23:40:12 +0800 |
parents | 0ac794e0e285 |
children | 14b6afc6cb28 |
line wrap: on
line diff
--- a/mercurial/bundle2.py Fri Oct 05 23:27:17 2018 +0800 +++ b/mercurial/bundle2.py Fri Oct 05 23:40:12 2018 +0800 @@ -1700,7 +1700,10 @@ 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,