# HG changeset patch # User Pierre-Yves David # Date 1509000290 -7200 # Node ID 544354cfc626fee5cdc4796ca0dcd5d1c71855bd # Parent ddfdef7e9b5875dc542b4796fc26e30a7f66932e pushkey: forbid usage of pushley to exchange markers The pushkey based protocol lacks many important feature and is very slow. We disable it to prevent any usage by mistake. diff -r ddfdef7e9b58 -r 544354cfc626 CHANGELOG --- a/CHANGELOG Thu Oct 26 08:29:36 2017 +0200 +++ b/CHANGELOG Thu Oct 26 08:44:50 2017 +0200 @@ -6,6 +6,7 @@ * drop compatibility with Mercurial 3.8, 3.9 and 4.0, * drop support for old and deprecated method to exchange obsmarkers, + * forbid usage of the old pushbey based protocol to exchange obsmarkers, 6.8.0 -- 2017-10-23 ------------------- diff -r ddfdef7e9b58 -r 544354cfc626 hgext3rd/evolve/obsexchange.py --- a/hgext3rd/evolve/obsexchange.py Thu Oct 26 08:29:36 2017 +0200 +++ b/hgext3rd/evolve/obsexchange.py Thu Oct 26 08:44:50 2017 +0200 @@ -16,11 +16,13 @@ from mercurial import ( bundle2, + error, exchange, extensions, lock as lockmod, node, obsolete, + pushkey, util, wireproto, ) @@ -191,3 +193,14 @@ finaldata.write(obsdata) finaldata.seek(0) return wireproto.streamres(reader=finaldata, v1compressible=True) + +abortmsg = "won't exchange obsmarkers through pushkey" +hint = "upgrade your client or server to use the bundle2 protocol" + +def forbidpushkey(repo=None, key=None, old=None, new=None): + """prevent exchange through pushkey""" + raise error.Abort(abortmsg, hint=hint) + +@eh.uisetup +def setuppushkeyforbidding(ui): + pushkey._namespaces['obsolete'] = (forbidpushkey, forbidpushkey)