Patchwork [8,of,8,V2] phase: use a binary phase part to push through bundle2 (BC)

login
register
mail settings
Submitter Boris Feld
Date Oct. 16, 2017, 6:23 p.m.
Message ID <76e192debcd8036c6695.1508178229@FB>
Download mbox | patch
Permalink /patch/25023/
State Accepted
Headers show

Comments

Boris Feld - Oct. 16, 2017, 6:23 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1505929086 -7200
#      Wed Sep 20 19:38:06 2017 +0200
# Node ID 76e192debcd8036c6695b56681ca096690322880
# Parent  9c084f14df72a2d511d414e0ecf50a086c0a2341
# EXP-Topic b2.phases.push
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 76e192debcd8
phase: use a binary phase part to push through bundle2 (BC)

The part we are using for pull is now used for push too. As we no longer use
pushkey, pushkey hook are no longer triggered. This is an obvious backward
incompatible change. We could artificially trigger the pushkey hook within the
bundle2 part, but this seemed too hacky to me.

An option would be to disable by default this new mechanism for a couple of
versions to help people migrate to `txnclose-phase`. I took the liberal and
optimistic path to just turn it on by default directly.

.. bc::

   Push no longer trigger a pushkey hook when updating phases.  Use the new
   `txnclose-phase` and `txnclose-phase` hooks instead.
   (Apply when both server and client use version 4.4 or above).
Boris Feld - Oct. 17, 2017, 1:52 p.m.
We think that having this series in 4.4 release is quite important. We
added the new 'phases' bundle2 capability and associated pull support
in the 4.4 cycle. Not having push support in the same release (4.4)
means push support will not be covered by the new capability and we'll
have to distinct the two kinds of clients in the future. That is more
cumbersome to manage that we hoped when this series was written.

Also (but not directly related), we have a 14 patches series that
improves the bookmark exchange by using a binary part (resolving also
the old regression https://bz.mercurial-scm.org/show_bug.cgi?id=5165)
but it depends on this one.

I'm not sure we would have time to queue it, should I send it if this
one is queued?

On Mon, 2017-10-16 at 20:23 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1505929086 -7200
> #      Wed Sep 20 19:38:06 2017 +0200
> # Node ID 76e192debcd8036c6695b56681ca096690322880
> # Parent  9c084f14df72a2d511d414e0ecf50a086c0a2341
> # EXP-Topic b2.phases.push
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/
>  -r 76e192debcd8
> phase: use a binary phase part to push through bundle2 (BC)
> 
> The part we are using for pull is now used for push too. As we no
> longer use
> pushkey, pushkey hook are no longer triggered. This is an obvious
> backward
> incompatible change. We could artificially trigger the pushkey hook
> within the
> bundle2 part, but this seemed too hacky to me.
> 
> An option would be to disable by default this new mechanism for a
> couple of
> versions to help people migrate to `txnclose-phase`. I took the
> liberal and
> optimistic path to just turn it on by default directly.
> 
> .. bc::
> 
>    Push no longer trigger a pushkey hook when updating phases.  Use
> the new
>    `txnclose-phase` and `txnclose-phase` hooks instead.
>    (Apply when both server and client use version 4.4 or above).
> 
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -806,9 +806,26 @@
>      if 'phases' in pushop.stepsdone:
>          return
>      b2caps = bundle2.bundle2caps(pushop.remote)
> -    if 'pushkey' in b2caps:
> +    ui = pushop.repo.ui
> +
> +    legacyphase = 'phases' in ui.configlist('devel',
> 'legacy.exchange')
> +    haspushkey = 'pushkey' in b2caps
> +    hasphaseheads = 'heads' in b2caps.get('phases', ())
> +
> +    if hasphaseheads and not legacyphase:
> +        _pushb2phaseheads(pushop, bundler)
> +    elif haspushkey:
>          _pushb2phasespushkey(pushop, bundler)
>  
> +def _pushb2phaseheads(pushop, bundler):
> +    """push phase information through a bundle2 - pushkey part"""
> +    pushop.stepsdone.add('phases')
> +    if pushop.outdatedphases:
> +        updates = [[] for p in phases.allphases]
> +        updates[0].extend(h.node() for h in pushop.outdatedphases)
> +        phasedata = phases.binaryencode(updates)
> +        bundler.newpart('phase-heads', data=phasedata)
> +
>  def _pushb2phasespushkey(pushop, bundler):
>      """push phase information through a bundle2 - pushkey part"""
>      pushop.stepsdone.add('phases')
> diff --git a/tests/test-acl.t b/tests/test-acl.t
> --- a/tests/test-acl.t
> +++ b/tests/test-acl.t
> @@ -97,7 +97,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -117,17 +117,15 @@
>    adding quux/file.py revisions
>    added 3 changesets with 3 changes to 3 files
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -162,7 +160,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -184,17 +182,15 @@
>    calling hook pretxnchangegroup.acl: hgext.acl.hook
>    acl: changes have source "push" - skipping
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -230,7 +226,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -262,17 +258,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -308,7 +302,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -336,6 +330,7 @@
>    acl: branch access granted: "ef1ea85a6374" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> allowed on "foo/file.txt" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -375,7 +370,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -407,6 +402,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -447,7 +443,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -475,6 +471,7 @@
>    acl: branch access granted: "ef1ea85a6374" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "barney" not
> allowed on "foo/file.txt" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -516,7 +513,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -548,6 +545,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -590,7 +588,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -620,6 +618,7 @@
>    acl: branch access granted: "f9cafe1212c8" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied
> on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -661,7 +660,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -689,6 +688,7 @@
>    acl: branch access granted: "ef1ea85a6374" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "barney" not
> allowed on "foo/file.txt" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -734,7 +734,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -766,17 +766,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -819,7 +817,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -851,6 +849,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "wilma" not
> allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -899,7 +898,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -922,6 +921,7 @@
>    acl: checking access for user "barney"
>    error: pretxnchangegroup.acl hook raised an exception: [Errno *] *
> (glob)
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -974,7 +974,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1006,6 +1006,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "betty" not
> allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -1060,7 +1061,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1092,17 +1093,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -1148,7 +1147,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1180,17 +1179,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -1232,7 +1229,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1262,6 +1259,7 @@
>    acl: branch access granted: "f9cafe1212c8" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied
> on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -1310,7 +1308,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1343,17 +1341,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -1395,7 +1391,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1427,6 +1423,7 @@
>    acl: branch access granted: "f9cafe1212c8" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied
> on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -1509,13 +1506,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1551,21 +1547,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -1600,13 +1590,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1641,7 +1630,8 @@
>    acl: path access granted: "911600dab2ae"
>    error: pretxnchangegroup.acl hook failed: acl: user "astro" denied
> on branch "foobar" (changeset "e8fc755d4d82")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "astro" denied on branch "foobar" (changeset
> "e8fc755d4d82")
> @@ -1677,13 +1667,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1712,7 +1701,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "astro" not
> allowed on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "astro" not allowed on branch "default"
> (changeset "ef1ea85a6374")
> @@ -1750,13 +1740,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1785,7 +1774,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "astro" not
> allowed on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "astro" not allowed on branch "default"
> (changeset "ef1ea85a6374")
> @@ -1817,13 +1807,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1859,21 +1848,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -1913,13 +1896,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1955,21 +1937,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -2008,13 +1984,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -2043,7 +2018,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "george"
> denied on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "george" denied on branch "default" (changeset
> "ef1ea85a6374")
> @@ -2080,13 +2056,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -2122,21 +2097,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -2169,13 +2138,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -2204,7 +2172,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "george"
> denied on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "george" denied on branch "default" (changeset
> "ef1ea85a6374")
> diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-
> exchange.t
> --- a/tests/test-bundle2-exchange.t
> +++ b/tests/test-bundle2-exchange.t
> @@ -252,9 +252,6 @@
>    remote: added 1 changesets with 0 changes to 0 files (-1 heads)
>    remote: 1 new obsolescence markers
>    remote: pre-close-tip:eea13746799a public book_eea1
> -  remote: pushkey: lock state after "phases"
> -  remote: lock:  free
> -  remote: wlock: free
>    remote: pushkey: lock state after "bookmarks"
>    remote: lock:  free
>    remote: wlock: free
> @@ -392,9 +389,6 @@
>    remote: added 1 changesets with 1 changes to 1 files
>    remote: 1 new obsolescence markers
>    remote: pre-close-tip:32af7686d403 public book_32af
> -  remote: pushkey: lock state after "phases"
> -  remote: lock:  free
> -  remote: wlock: free
>    remote: pushkey: lock state after "bookmarks"
>    remote: lock:  free
>    remote: wlock: free
> diff --git a/tests/test-push-http.t b/tests/test-push-http.t
> --- a/tests/test-push-http.t
> +++ b/tests/test-push-http.t
> @@ -70,7 +70,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> HG_NEW=0 HG_OLD=1 HG_RET=1
>    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> -> 0
>    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 
> 0
>    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> HG_HOOKTYPE=changegroup
> HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
> HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> @@ -89,7 +88,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> HG_NEW=0 HG_OLD=1 HG_RET=1
>    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> -> 0
>    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 
> 0
>    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> HG_HOOKTYPE=changegroup
> HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
> HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> @@ -108,7 +106,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> HG_NEW=0 HG_OLD=1 HG_RET=1
>    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> -> 0
>    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 
> 0
>    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> HG_HOOKTYPE=changegroup
> HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
> HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> @@ -124,6 +121,8 @@
>    > allow_push = *
>    > [hooks]
>    > prepushkey = sh -c "printenv.py prepushkey 1"
> +  > [devel]
> +  > legacy.exchange=phases
>    > EOF
>    $ req
>    pushing to http://localhost:$HGPORT/
> @@ -144,6 +143,8 @@
>  
>    $ cat >> .hg/hgrc <<EOF
>    > prepushkey = sh -c "printenv.py prepushkey 0"
> +  > [devel]
> +  > legacy.exchange=
>    > EOF
>    $ req
>    pushing to http://localhost:$HGPORT/
> @@ -152,7 +153,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey
> HG_HOOKTYPE=prepushkey
> HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1
> HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve
> HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
>    % serve errors
>    $ hg rollback
>    repository tip rolled back to revision 0 (undo serve)
Augie Fackler - Oct. 17, 2017, 3:17 p.m.
On Mon, Oct 16, 2017 at 08:23:49PM +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1505929086 -7200
> #      Wed Sep 20 19:38:06 2017 +0200
> # Node ID 76e192debcd8036c6695b56681ca096690322880
> # Parent  9c084f14df72a2d511d414e0ecf50a086c0a2341
> # EXP-Topic b2.phases.push
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 76e192debcd8
> phase: use a binary phase part to push through bundle2 (BC)

Patches 1-7 are queued, with some copyediting on patch 5. If my
comment below on the docstring is right, please follow up with a v3 of
this?

Thanks!

>
> The part we are using for pull is now used for push too. As we no longer use
> pushkey, pushkey hook are no longer triggered. This is an obvious backward
> incompatible change. We could artificially trigger the pushkey hook within the
> bundle2 part, but this seemed too hacky to me.
>
> An option would be to disable by default this new mechanism for a couple of
> versions to help people migrate to `txnclose-phase`. I took the liberal and
> optimistic path to just turn it on by default directly.
>
> .. bc::
>
>    Push no longer trigger a pushkey hook when updating phases.  Use the new

Nit: triggers, not trigger.

>    `txnclose-phase` and `txnclose-phase` hooks instead.
>    (Apply when both server and client use version 4.4 or above).

Nit: Applies not apply.

>
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -806,9 +806,26 @@
>      if 'phases' in pushop.stepsdone:
>          return
>      b2caps = bundle2.bundle2caps(pushop.remote)
> -    if 'pushkey' in b2caps:
> +    ui = pushop.repo.ui
> +
> +    legacyphase = 'phases' in ui.configlist('devel', 'legacy.exchange')
> +    haspushkey = 'pushkey' in b2caps
> +    hasphaseheads = 'heads' in b2caps.get('phases', ())
> +
> +    if hasphaseheads and not legacyphase:
> +        _pushb2phaseheads(pushop, bundler)
> +    elif haspushkey:
>          _pushb2phasespushkey(pushop, bundler)
>
> +def _pushb2phaseheads(pushop, bundler):
> +    """push phase information through a bundle2 - pushkey part"""

Er - isn't this the non-pushkey flavor?

> +    pushop.stepsdone.add('phases')
> +    if pushop.outdatedphases:
> +        updates = [[] for p in phases.allphases]
> +        updates[0].extend(h.node() for h in pushop.outdatedphases)
> +        phasedata = phases.binaryencode(updates)
> +        bundler.newpart('phase-heads', data=phasedata)
> +
>  def _pushb2phasespushkey(pushop, bundler):
>      """push phase information through a bundle2 - pushkey part"""
>      pushop.stepsdone.add('phases')
> diff --git a/tests/test-acl.t b/tests/test-acl.t
> --- a/tests/test-acl.t
> +++ b/tests/test-acl.t
> @@ -97,7 +97,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -117,17 +117,15 @@
>    adding quux/file.py revisions
>    added 3 changesets with 3 changes to 3 files
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -162,7 +160,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -184,17 +182,15 @@
>    calling hook pretxnchangegroup.acl: hgext.acl.hook
>    acl: changes have source "push" - skipping
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -230,7 +226,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -262,17 +258,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -308,7 +302,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -336,6 +330,7 @@
>    acl: branch access granted: "ef1ea85a6374" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -375,7 +370,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -407,6 +402,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -447,7 +443,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -475,6 +471,7 @@
>    acl: branch access granted: "ef1ea85a6374" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -516,7 +513,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -548,6 +545,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -590,7 +588,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -620,6 +618,7 @@
>    acl: branch access granted: "f9cafe1212c8" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -661,7 +660,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -689,6 +688,7 @@
>    acl: branch access granted: "ef1ea85a6374" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -734,7 +734,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -766,17 +766,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -819,7 +817,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -851,6 +849,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -899,7 +898,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -922,6 +921,7 @@
>    acl: checking access for user "barney"
>    error: pretxnchangegroup.acl hook raised an exception: [Errno *] * (glob)
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -974,7 +974,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1006,6 +1006,7 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -1060,7 +1061,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1092,17 +1093,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -1148,7 +1147,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1180,17 +1179,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -1232,7 +1229,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1262,6 +1259,7 @@
>    acl: branch access granted: "f9cafe1212c8" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -1310,7 +1308,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1343,17 +1341,15 @@
>    acl: branch access granted: "911600dab2ae" on branch "default"
>    acl: path access granted: "911600dab2ae"
>    bundle2-input-part: total payload size 1553
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 2 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 1 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 0 (undo push)
>    0:6675d58eff77
> @@ -1395,7 +1391,7 @@
>    bundle2-output-part: "check:phases" 24 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 24 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1427,6 +1423,7 @@
>    acl: branch access granted: "f9cafe1212c8" on branch "default"
>    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
>    bundle2-input-part: total payload size 1553
> +  bundle2-input-part: total payload size 24
>    bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
> @@ -1509,13 +1506,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1551,21 +1547,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -1600,13 +1590,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1641,7 +1630,8 @@
>    acl: path access granted: "911600dab2ae"
>    error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
> @@ -1677,13 +1667,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1712,7 +1701,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
> @@ -1750,13 +1740,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1785,7 +1774,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
> @@ -1817,13 +1807,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1859,21 +1848,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -1913,13 +1896,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -1955,21 +1937,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -2008,13 +1984,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -2043,7 +2018,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
> @@ -2080,13 +2056,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -2122,21 +2097,15 @@
>    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
>    acl: path access granted: "e8fc755d4d82"
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: "phase-heads" supported
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    updating the branch cache
> -  bundle2-output-bundle: "HG20", 3 parts total
> +  bundle2-output-bundle: "HG20", 1 parts total
>    bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
> -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
>    bundle2-input-bundle: no-transaction
>    bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> -  bundle2-input-bundle: 2 parts total
> +  bundle2-input-bundle: 0 parts total
>    listing keys for "phases"
>    repository tip rolled back to revision 2 (undo push)
>    2:fb35475503ef
> @@ -2169,13 +2138,12 @@
>    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
>    911600dab2ae7a9baff75958b84fe606851ce955
>    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> -  bundle2-output-bundle: "HG20", 6 parts total
> +  bundle2-output-bundle: "HG20", 5 parts total
>    bundle2-output-part: "replycaps" 168 bytes payload
>    bundle2-output-part: "check:phases" 48 bytes payload
>    bundle2-output-part: "check:heads" streamed payload
>    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> +  bundle2-output-part: "phase-heads" 48 bytes payload
>    bundle2-input-bundle: with-transaction
>    bundle2-input-part: "replycaps" supported
>    bundle2-input-part: total payload size 168
> @@ -2204,7 +2172,8 @@
>    acl: acl.deny not enabled
>    error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
>    bundle2-input-part: total payload size 2068
> -  bundle2-input-bundle: 5 parts total
> +  bundle2-input-part: total payload size 48
> +  bundle2-input-bundle: 4 parts total
>    transaction abort!
>    rollback completed
>    abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
> diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t
> --- a/tests/test-bundle2-exchange.t
> +++ b/tests/test-bundle2-exchange.t
> @@ -252,9 +252,6 @@
>    remote: added 1 changesets with 0 changes to 0 files (-1 heads)
>    remote: 1 new obsolescence markers
>    remote: pre-close-tip:eea13746799a public book_eea1
> -  remote: pushkey: lock state after "phases"
> -  remote: lock:  free
> -  remote: wlock: free
>    remote: pushkey: lock state after "bookmarks"
>    remote: lock:  free
>    remote: wlock: free
> @@ -392,9 +389,6 @@
>    remote: added 1 changesets with 1 changes to 1 files
>    remote: 1 new obsolescence markers
>    remote: pre-close-tip:32af7686d403 public book_32af
> -  remote: pushkey: lock state after "phases"
> -  remote: lock:  free
> -  remote: wlock: free
>    remote: pushkey: lock state after "bookmarks"
>    remote: lock:  free
>    remote: wlock: free
> diff --git a/tests/test-push-http.t b/tests/test-push-http.t
> --- a/tests/test-push-http.t
> +++ b/tests/test-push-http.t
> @@ -70,7 +70,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
>    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
>    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
>    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> @@ -89,7 +88,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
>    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
>    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
>    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> @@ -108,7 +106,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
>    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
>    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
>    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> @@ -124,6 +121,8 @@
>    > allow_push = *
>    > [hooks]
>    > prepushkey = sh -c "printenv.py prepushkey 1"
> +  > [devel]
> +  > legacy.exchange=phases
>    > EOF
>    $ req
>    pushing to http://localhost:$HGPORT/
> @@ -144,6 +143,8 @@
>
>    $ cat >> .hg/hgrc <<EOF
>    > prepushkey = sh -c "printenv.py prepushkey 0"
> +  > [devel]
> +  > legacy.exchange=
>    > EOF
>    $ req
>    pushing to http://localhost:$HGPORT/
> @@ -152,7 +153,6 @@
>    remote: adding manifests
>    remote: adding file changes
>    remote: added 1 changesets with 1 changes to 1 files
> -  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
>    % serve errors
>    $ hg rollback
>    repository tip rolled back to revision 0 (undo serve)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Augie Fackler - Oct. 17, 2017, 3:18 p.m.
On Tue, Oct 17, 2017 at 03:52:42PM +0200, Boris Feld wrote:
> We think that having this series in 4.4 release is quite important. We
> added the new 'phases' bundle2 capability and associated pull support
> in the 4.4 cycle. Not having push support in the same release (4.4)
> means push support will not be covered by the new capability and we'll
> have to distinct the two kinds of clients in the future. That is more
> cumbersome to manage that we hoped when this series was written.
>
> Also (but not directly related), we have a 14 patches series that
> improves the bookmark exchange by using a binary part (resolving also
> the old regression https://bz.mercurial-scm.org/show_bug.cgi?id=5165)
> but it depends on this one.
>
> I'm not sure we would have time to queue it, should I send it if this
> one is queued?

I'm extremely interested in getting 5165 fixed - how involved are the
patches? Maybe give me a link here and I'll see if we should try and
get the fix in...

>
> On Mon, 2017-10-16 at 20:23 +0200, Boris Feld wrote:
> > # HG changeset patch
> > # User Boris Feld <boris.feld@octobus.net>
> > # Date 1505929086 -7200
> > #      Wed Sep 20 19:38:06 2017 +0200
> > # Node ID 76e192debcd8036c6695b56681ca096690322880
> > # Parent  9c084f14df72a2d511d414e0ecf50a086c0a2341
> > # EXP-Topic b2.phases.push
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #              hg pull https://bitbucket.org/octobus/mercurial-devel/
> >  -r 76e192debcd8
> > phase: use a binary phase part to push through bundle2 (BC)
> >
> > The part we are using for pull is now used for push too. As we no
> > longer use
> > pushkey, pushkey hook are no longer triggered. This is an obvious
> > backward
> > incompatible change. We could artificially trigger the pushkey hook
> > within the
> > bundle2 part, but this seemed too hacky to me.
> >
> > An option would be to disable by default this new mechanism for a
> > couple of
> > versions to help people migrate to `txnclose-phase`. I took the
> > liberal and
> > optimistic path to just turn it on by default directly.
> >
> > .. bc::
> >
> >    Push no longer trigger a pushkey hook when updating phases.  Use
> > the new
> >    `txnclose-phase` and `txnclose-phase` hooks instead.
> >    (Apply when both server and client use version 4.4 or above).
> >
> > diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> > --- a/mercurial/exchange.py
> > +++ b/mercurial/exchange.py
> > @@ -806,9 +806,26 @@
> >      if 'phases' in pushop.stepsdone:
> >          return
> >      b2caps = bundle2.bundle2caps(pushop.remote)
> > -    if 'pushkey' in b2caps:
> > +    ui = pushop.repo.ui
> > +
> > +    legacyphase = 'phases' in ui.configlist('devel',
> > 'legacy.exchange')
> > +    haspushkey = 'pushkey' in b2caps
> > +    hasphaseheads = 'heads' in b2caps.get('phases', ())
> > +
> > +    if hasphaseheads and not legacyphase:
> > +        _pushb2phaseheads(pushop, bundler)
> > +    elif haspushkey:
> >          _pushb2phasespushkey(pushop, bundler)
> >
> > +def _pushb2phaseheads(pushop, bundler):
> > +    """push phase information through a bundle2 - pushkey part"""
> > +    pushop.stepsdone.add('phases')
> > +    if pushop.outdatedphases:
> > +        updates = [[] for p in phases.allphases]
> > +        updates[0].extend(h.node() for h in pushop.outdatedphases)
> > +        phasedata = phases.binaryencode(updates)
> > +        bundler.newpart('phase-heads', data=phasedata)
> > +
> >  def _pushb2phasespushkey(pushop, bundler):
> >      """push phase information through a bundle2 - pushkey part"""
> >      pushop.stepsdone.add('phases')
> > diff --git a/tests/test-acl.t b/tests/test-acl.t
> > --- a/tests/test-acl.t
> > +++ b/tests/test-acl.t
> > @@ -97,7 +97,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -117,17 +117,15 @@
> >    adding quux/file.py revisions
> >    added 3 changesets with 3 changes to 3 files
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -162,7 +160,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -184,17 +182,15 @@
> >    calling hook pretxnchangegroup.acl: hgext.acl.hook
> >    acl: changes have source "push" - skipping
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -230,7 +226,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -262,17 +258,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -308,7 +302,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -336,6 +330,7 @@
> >    acl: branch access granted: "ef1ea85a6374" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> > allowed on "foo/file.txt" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -375,7 +370,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -407,6 +402,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -447,7 +443,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -475,6 +471,7 @@
> >    acl: branch access granted: "ef1ea85a6374" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "barney" not
> > allowed on "foo/file.txt" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -516,7 +513,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -548,6 +545,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -590,7 +588,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -620,6 +618,7 @@
> >    acl: branch access granted: "f9cafe1212c8" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied
> > on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -661,7 +660,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -689,6 +688,7 @@
> >    acl: branch access granted: "ef1ea85a6374" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "barney" not
> > allowed on "foo/file.txt" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -734,7 +734,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -766,17 +766,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -819,7 +817,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -851,6 +849,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "wilma" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -899,7 +898,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -922,6 +921,7 @@
> >    acl: checking access for user "barney"
> >    error: pretxnchangegroup.acl hook raised an exception: [Errno *] *
> > (glob)
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -974,7 +974,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1006,6 +1006,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "betty" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -1060,7 +1061,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1092,17 +1093,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -1148,7 +1147,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1180,17 +1179,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -1232,7 +1229,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1262,6 +1259,7 @@
> >    acl: branch access granted: "f9cafe1212c8" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied
> > on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -1310,7 +1308,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1343,17 +1341,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -1395,7 +1391,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1427,6 +1423,7 @@
> >    acl: branch access granted: "f9cafe1212c8" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" denied
> > on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -1509,13 +1506,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1551,21 +1547,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -1600,13 +1590,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1641,7 +1630,8 @@
> >    acl: path access granted: "911600dab2ae"
> >    error: pretxnchangegroup.acl hook failed: acl: user "astro" denied
> > on branch "foobar" (changeset "e8fc755d4d82")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "astro" denied on branch "foobar" (changeset
> > "e8fc755d4d82")
> > @@ -1677,13 +1667,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1712,7 +1701,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "astro" not
> > allowed on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "astro" not allowed on branch "default"
> > (changeset "ef1ea85a6374")
> > @@ -1750,13 +1740,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1785,7 +1774,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "astro" not
> > allowed on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "astro" not allowed on branch "default"
> > (changeset "ef1ea85a6374")
> > @@ -1817,13 +1807,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1859,21 +1848,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -1913,13 +1896,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1955,21 +1937,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -2008,13 +1984,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -2043,7 +2018,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "george"
> > denied on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "george" denied on branch "default" (changeset
> > "ef1ea85a6374")
> > @@ -2080,13 +2056,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -2122,21 +2097,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -2169,13 +2138,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory) streamed
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -2204,7 +2172,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "george"
> > denied on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "george" denied on branch "default" (changeset
> > "ef1ea85a6374")
> > diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-
> > exchange.t
> > --- a/tests/test-bundle2-exchange.t
> > +++ b/tests/test-bundle2-exchange.t
> > @@ -252,9 +252,6 @@
> >    remote: added 1 changesets with 0 changes to 0 files (-1 heads)
> >    remote: 1 new obsolescence markers
> >    remote: pre-close-tip:eea13746799a public book_eea1
> > -  remote: pushkey: lock state after "phases"
> > -  remote: lock:  free
> > -  remote: wlock: free
> >    remote: pushkey: lock state after "bookmarks"
> >    remote: lock:  free
> >    remote: wlock: free
> > @@ -392,9 +389,6 @@
> >    remote: added 1 changesets with 1 changes to 1 files
> >    remote: 1 new obsolescence markers
> >    remote: pre-close-tip:32af7686d403 public book_32af
> > -  remote: pushkey: lock state after "phases"
> > -  remote: lock:  free
> > -  remote: wlock: free
> >    remote: pushkey: lock state after "bookmarks"
> >    remote: lock:  free
> >    remote: wlock: free
> > diff --git a/tests/test-push-http.t b/tests/test-push-http.t
> > --- a/tests/test-push-http.t
> > +++ b/tests/test-push-http.t
> > @@ -70,7 +70,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_OLD=1 HG_RET=1
> >    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> > -> 0
> >    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   ->
> > 0
> >    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> > HG_HOOKTYPE=changegroup
> > HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
> > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> > @@ -89,7 +88,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_OLD=1 HG_RET=1
> >    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> > -> 0
> >    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   ->
> > 0
> >    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> > HG_HOOKTYPE=changegroup
> > HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
> > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> > @@ -108,7 +106,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_OLD=1 HG_RET=1
> >    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> > -> 0
> >    remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   ->
> > 0
> >    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> > HG_HOOKTYPE=changegroup
> > HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
> > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> > @@ -124,6 +121,8 @@
> >    > allow_push = *
> >    > [hooks]
> >    > prepushkey = sh -c "printenv.py prepushkey 1"
> > +  > [devel]
> > +  > legacy.exchange=phases
> >    > EOF
> >    $ req
> >    pushing to http://localhost:$HGPORT/
> > @@ -144,6 +143,8 @@
> >
> >    $ cat >> .hg/hgrc <<EOF
> >    > prepushkey = sh -c "printenv.py prepushkey 0"
> > +  > [devel]
> > +  > legacy.exchange=
> >    > EOF
> >    $ req
> >    pushing to http://localhost:$HGPORT/
> > @@ -152,7 +153,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey
> > HG_HOOKTYPE=prepushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1
> > HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve
> > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> >    % serve errors
> >    $ hg rollback
> >    repository tip rolled back to revision 0 (undo serve)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Boris Feld - Oct. 17, 2017, 5:12 p.m.
On Tue, 2017-10-17 at 11:17 -0400, Augie Fackler wrote:
> On Mon, Oct 16, 2017 at 08:23:49PM +0200, Boris Feld wrote:
> > # HG changeset patch
> > # User Boris Feld <boris.feld@octobus.net>
> > # Date 1505929086 -7200
> > #      Wed Sep 20 19:38:06 2017 +0200
> > # Node ID 76e192debcd8036c6695b56681ca096690322880
> > # Parent  9c084f14df72a2d511d414e0ecf50a086c0a2341
> > # EXP-Topic b2.phases.push
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #              hg pull https://bitbucket.org/octobus/mercurial-deve
> > l/ -r 76e192debcd8
> > phase: use a binary phase part to push through bundle2 (BC)
> 
> Patches 1-7 are queued, with some copyediting on patch 5. If my
> comment below on the docstring is right, please follow up with a v3
> of
> this?
> 
> Thanks!

I just sent the V3 version. Thank you for the copyediting on patch 5, I
missed it during my review. 

> 
> > 
> > The part we are using for pull is now used for push too. As we no
> > longer use
> > pushkey, pushkey hook are no longer triggered. This is an obvious
> > backward
> > incompatible change. We could artificially trigger the pushkey hook
> > within the
> > bundle2 part, but this seemed too hacky to me.
> > 
> > An option would be to disable by default this new mechanism for a
> > couple of
> > versions to help people migrate to `txnclose-phase`. I took the
> > liberal and
> > optimistic path to just turn it on by default directly.
> > 
> > .. bc::
> > 
> >    Push no longer trigger a pushkey hook when updating phases.  Use
> > the new
> 
> Nit: triggers, not trigger.
> 
> >    `txnclose-phase` and `txnclose-phase` hooks instead.
> >    (Apply when both server and client use version 4.4 or above).
> 
> Nit: Applies not apply.
> 
> > 
> > diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> > --- a/mercurial/exchange.py
> > +++ b/mercurial/exchange.py
> > @@ -806,9 +806,26 @@
> >      if 'phases' in pushop.stepsdone:
> >          return
> >      b2caps = bundle2.bundle2caps(pushop.remote)
> > -    if 'pushkey' in b2caps:
> > +    ui = pushop.repo.ui
> > +
> > +    legacyphase = 'phases' in ui.configlist('devel',
> > 'legacy.exchange')
> > +    haspushkey = 'pushkey' in b2caps
> > +    hasphaseheads = 'heads' in b2caps.get('phases', ())
> > +
> > +    if hasphaseheads and not legacyphase:
> > +        _pushb2phaseheads(pushop, bundler)
> > +    elif haspushkey:
> >          _pushb2phasespushkey(pushop, bundler)
> > 
> > +def _pushb2phaseheads(pushop, bundler):
> > +    """push phase information through a bundle2 - pushkey part"""
> 
> Er - isn't this the non-pushkey flavor?
> 
> > +    pushop.stepsdone.add('phases')
> > +    if pushop.outdatedphases:
> > +        updates = [[] for p in phases.allphases]
> > +        updates[0].extend(h.node() for h in pushop.outdatedphases)
> > +        phasedata = phases.binaryencode(updates)
> > +        bundler.newpart('phase-heads', data=phasedata)
> > +
> >  def _pushb2phasespushkey(pushop, bundler):
> >      """push phase information through a bundle2 - pushkey part"""
> >      pushop.stepsdone.add('phases')
> > diff --git a/tests/test-acl.t b/tests/test-acl.t
> > --- a/tests/test-acl.t
> > +++ b/tests/test-acl.t
> > @@ -97,7 +97,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -117,17 +117,15 @@
> >    adding quux/file.py revisions
> >    added 3 changesets with 3 changes to 3 files
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -162,7 +160,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -184,17 +182,15 @@
> >    calling hook pretxnchangegroup.acl: hgext.acl.hook
> >    acl: changes have source "push" - skipping
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -230,7 +226,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -262,17 +258,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -308,7 +302,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -336,6 +330,7 @@
> >    acl: branch access granted: "ef1ea85a6374" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> > allowed on "foo/file.txt" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -375,7 +370,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -407,6 +402,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -447,7 +443,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -475,6 +471,7 @@
> >    acl: branch access granted: "ef1ea85a6374" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "barney" not
> > allowed on "foo/file.txt" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -516,7 +513,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -548,6 +545,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -590,7 +588,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -620,6 +618,7 @@
> >    acl: branch access granted: "f9cafe1212c8" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred"
> > denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -661,7 +660,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -689,6 +688,7 @@
> >    acl: branch access granted: "ef1ea85a6374" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "barney" not
> > allowed on "foo/file.txt" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -734,7 +734,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -766,17 +766,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -819,7 +817,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -851,6 +849,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "wilma" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -899,7 +898,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -922,6 +921,7 @@
> >    acl: checking access for user "barney"
> >    error: pretxnchangegroup.acl hook raised an exception: [Errno *]
> > * (glob)
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -974,7 +974,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1006,6 +1006,7 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "betty" not
> > allowed on "quux/file.py" (changeset "911600dab2ae")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -1060,7 +1061,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1092,17 +1093,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -1148,7 +1147,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1180,17 +1179,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -1232,7 +1229,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1262,6 +1259,7 @@
> >    acl: branch access granted: "f9cafe1212c8" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred"
> > denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -1310,7 +1308,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1343,17 +1341,15 @@
> >    acl: branch access granted: "911600dab2ae" on branch "default"
> >    acl: path access granted: "911600dab2ae"
> >    bundle2-input-part: total payload size 1553
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 2 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 1 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 0 (undo push)
> >    0:6675d58eff77
> > @@ -1395,7 +1391,7 @@
> >    bundle2-output-part: "check:phases" 24 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 24 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1427,6 +1423,7 @@
> >    acl: branch access granted: "f9cafe1212c8" on branch "default"
> >    error: pretxnchangegroup.acl hook failed: acl: user "fred"
> > denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
> >    bundle2-input-part: total payload size 1553
> > +  bundle2-input-part: total payload size 24
> >    bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> > @@ -1509,13 +1506,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1551,21 +1547,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -1600,13 +1590,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1641,7 +1630,8 @@
> >    acl: path access granted: "911600dab2ae"
> >    error: pretxnchangegroup.acl hook failed: acl: user "astro"
> > denied on branch "foobar" (changeset "e8fc755d4d82")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "astro" denied on branch "foobar" (changeset
> > "e8fc755d4d82")
> > @@ -1677,13 +1667,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1712,7 +1701,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "astro" not
> > allowed on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "astro" not allowed on branch "default"
> > (changeset "ef1ea85a6374")
> > @@ -1750,13 +1740,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1785,7 +1774,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "astro" not
> > allowed on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "astro" not allowed on branch "default"
> > (changeset "ef1ea85a6374")
> > @@ -1817,13 +1807,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1859,21 +1848,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -1913,13 +1896,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -1955,21 +1937,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -2008,13 +1984,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -2043,7 +2018,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "george"
> > denied on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "george" denied on branch "default" (changeset
> > "ef1ea85a6374")
> > @@ -2080,13 +2056,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -2122,21 +2097,15 @@
> >    acl: branch access granted: "e8fc755d4d82" on branch "foobar"
> >    acl: path access granted: "e8fc755d4d82"
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:911600dab2ae7a9baff75958b84fe606851ce955"
> > -  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
> > -  pushing key for
> > "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: "phase-heads" supported
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    updating the branch cache
> > -  bundle2-output-bundle: "HG20", 3 parts total
> > +  bundle2-output-bundle: "HG20", 1 parts total
> >    bundle2-output-part: "reply:changegroup" (advisory) (params: 0
> > advisory) empty payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> > -  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty
> > payload
> >    bundle2-input-bundle: no-transaction
> >    bundle2-input-part: "reply:changegroup" (advisory) (params: 0
> > advisory) supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-part: "reply:pushkey" (params: 0 advisory)
> > supported
> > -  bundle2-input-bundle: 2 parts total
> > +  bundle2-input-bundle: 0 parts total
> >    listing keys for "phases"
> >    repository tip rolled back to revision 2 (undo push)
> >    2:fb35475503ef
> > @@ -2169,13 +2138,12 @@
> >    f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
> >    911600dab2ae7a9baff75958b84fe606851ce955
> >    e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
> > -  bundle2-output-bundle: "HG20", 6 parts total
> > +  bundle2-output-bundle: "HG20", 5 parts total
> >    bundle2-output-part: "replycaps" 168 bytes payload
> >    bundle2-output-part: "check:phases" 48 bytes payload
> >    bundle2-output-part: "check:heads" streamed payload
> >    bundle2-output-part: "changegroup" (params: 1 mandatory)
> > streamed payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > -  bundle2-output-part: "pushkey" (params: 4 mandatory) empty
> > payload
> > +  bundle2-output-part: "phase-heads" 48 bytes payload
> >    bundle2-input-bundle: with-transaction
> >    bundle2-input-part: "replycaps" supported
> >    bundle2-input-part: total payload size 168
> > @@ -2204,7 +2172,8 @@
> >    acl: acl.deny not enabled
> >    error: pretxnchangegroup.acl hook failed: acl: user "george"
> > denied on branch "default" (changeset "ef1ea85a6374")
> >    bundle2-input-part: total payload size 2068
> > -  bundle2-input-bundle: 5 parts total
> > +  bundle2-input-part: total payload size 48
> > +  bundle2-input-bundle: 4 parts total
> >    transaction abort!
> >    rollback completed
> >    abort: acl: user "george" denied on branch "default" (changeset
> > "ef1ea85a6374")
> > diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-
> > exchange.t
> > --- a/tests/test-bundle2-exchange.t
> > +++ b/tests/test-bundle2-exchange.t
> > @@ -252,9 +252,6 @@
> >    remote: added 1 changesets with 0 changes to 0 files (-1 heads)
> >    remote: 1 new obsolescence markers
> >    remote: pre-close-tip:eea13746799a public book_eea1
> > -  remote: pushkey: lock state after "phases"
> > -  remote: lock:  free
> > -  remote: wlock: free
> >    remote: pushkey: lock state after "bookmarks"
> >    remote: lock:  free
> >    remote: wlock: free
> > @@ -392,9 +389,6 @@
> >    remote: added 1 changesets with 1 changes to 1 files
> >    remote: 1 new obsolescence markers
> >    remote: pre-close-tip:32af7686d403 public book_32af
> > -  remote: pushkey: lock state after "phases"
> > -  remote: lock:  free
> > -  remote: wlock: free
> >    remote: pushkey: lock state after "bookmarks"
> >    remote: lock:  free
> >    remote: wlock: free
> > diff --git a/tests/test-push-http.t b/tests/test-push-http.t
> > --- a/tests/test-push-http.t
> > +++ b/tests/test-push-http.t
> > @@ -70,7 +70,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_OLD=1 HG_RET=1
> >    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> > -> 0
> >    remote: phase-move:
> > ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
> >    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> > HG_HOOKTYPE=changegroup
> > HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP:
> > (glob)
> > @@ -89,7 +88,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_OLD=1 HG_RET=1
> >    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> > -> 0
> >    remote: phase-move:
> > ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
> >    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> > HG_HOOKTYPE=changegroup
> > HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP:
> > (glob)
> > @@ -108,7 +106,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_OLD=1 HG_RET=1
> >    remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1
> > -> 0
> >    remote: phase-move:
> > ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
> >    remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup
> > HG_HOOKTYPE=changegroup
> > HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP:
> > (glob)
> > @@ -124,6 +121,8 @@
> >    > allow_push = *
> >    > [hooks]
> >    > prepushkey = sh -c "printenv.py prepushkey 1"
> > +  > [devel]
> > +  > legacy.exchange=phases
> >    > EOF
> >    $ req
> >    pushing to http://localhost:$HGPORT/
> > @@ -144,6 +143,8 @@
> > 
> >    $ cat >> .hg/hgrc <<EOF
> >    > prepushkey = sh -c "printenv.py prepushkey 0"
> > +  > [devel]
> > +  > legacy.exchange=
> >    > EOF
> >    $ req
> >    pushing to http://localhost:$HGPORT/
> > @@ -152,7 +153,6 @@
> >    remote: adding manifests
> >    remote: adding file changes
> >    remote: added 1 changesets with 1 changes to 1 files
> > -  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey
> > HG_HOOKTYPE=prepushkey
> > HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
> > HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
> > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1
> > HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve
> > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
> >    % serve errors
> >    $ hg rollback
> >    repository tip rolled back to revision 0 (undo serve)
> > 
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -806,9 +806,26 @@ 
     if 'phases' in pushop.stepsdone:
         return
     b2caps = bundle2.bundle2caps(pushop.remote)
-    if 'pushkey' in b2caps:
+    ui = pushop.repo.ui
+
+    legacyphase = 'phases' in ui.configlist('devel', 'legacy.exchange')
+    haspushkey = 'pushkey' in b2caps
+    hasphaseheads = 'heads' in b2caps.get('phases', ())
+
+    if hasphaseheads and not legacyphase:
+        _pushb2phaseheads(pushop, bundler)
+    elif haspushkey:
         _pushb2phasespushkey(pushop, bundler)
 
+def _pushb2phaseheads(pushop, bundler):
+    """push phase information through a bundle2 - pushkey part"""
+    pushop.stepsdone.add('phases')
+    if pushop.outdatedphases:
+        updates = [[] for p in phases.allphases]
+        updates[0].extend(h.node() for h in pushop.outdatedphases)
+        phasedata = phases.binaryencode(updates)
+        bundler.newpart('phase-heads', data=phasedata)
+
 def _pushb2phasespushkey(pushop, bundler):
     """push phase information through a bundle2 - pushkey part"""
     pushop.stepsdone.add('phases')
diff --git a/tests/test-acl.t b/tests/test-acl.t
--- a/tests/test-acl.t
+++ b/tests/test-acl.t
@@ -97,7 +97,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -117,17 +117,15 @@ 
   adding quux/file.py revisions
   added 3 changesets with 3 changes to 3 files
   bundle2-input-part: total payload size 1553
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 2 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 1 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 0 (undo push)
   0:6675d58eff77
@@ -162,7 +160,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -184,17 +182,15 @@ 
   calling hook pretxnchangegroup.acl: hgext.acl.hook
   acl: changes have source "push" - skipping
   bundle2-input-part: total payload size 1553
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 2 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 1 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 0 (undo push)
   0:6675d58eff77
@@ -230,7 +226,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -262,17 +258,15 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   acl: path access granted: "911600dab2ae"
   bundle2-input-part: total payload size 1553
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 2 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 1 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 0 (undo push)
   0:6675d58eff77
@@ -308,7 +302,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -336,6 +330,7 @@ 
   acl: branch access granted: "ef1ea85a6374" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -375,7 +370,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -407,6 +402,7 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -447,7 +443,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -475,6 +471,7 @@ 
   acl: branch access granted: "ef1ea85a6374" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -516,7 +513,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -548,6 +545,7 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -590,7 +588,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -620,6 +618,7 @@ 
   acl: branch access granted: "f9cafe1212c8" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -661,7 +660,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -689,6 +688,7 @@ 
   acl: branch access granted: "ef1ea85a6374" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -734,7 +734,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -766,17 +766,15 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   acl: path access granted: "911600dab2ae"
   bundle2-input-part: total payload size 1553
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 2 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 1 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 0 (undo push)
   0:6675d58eff77
@@ -819,7 +817,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -851,6 +849,7 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -899,7 +898,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -922,6 +921,7 @@ 
   acl: checking access for user "barney"
   error: pretxnchangegroup.acl hook raised an exception: [Errno *] * (glob)
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -974,7 +974,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1006,6 +1006,7 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -1060,7 +1061,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1092,17 +1093,15 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   acl: path access granted: "911600dab2ae"
   bundle2-input-part: total payload size 1553
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 2 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 1 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 0 (undo push)
   0:6675d58eff77
@@ -1148,7 +1147,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1180,17 +1179,15 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   acl: path access granted: "911600dab2ae"
   bundle2-input-part: total payload size 1553
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 2 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 1 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 0 (undo push)
   0:6675d58eff77
@@ -1232,7 +1229,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1262,6 +1259,7 @@ 
   acl: branch access granted: "f9cafe1212c8" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -1310,7 +1308,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1343,17 +1341,15 @@ 
   acl: branch access granted: "911600dab2ae" on branch "default"
   acl: path access granted: "911600dab2ae"
   bundle2-input-part: total payload size 1553
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 2 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 1 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 0 (undo push)
   0:6675d58eff77
@@ -1395,7 +1391,7 @@ 
   bundle2-output-part: "check:phases" 24 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1427,6 +1423,7 @@ 
   acl: branch access granted: "f9cafe1212c8" on branch "default"
   error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
   bundle2-input-part: total payload size 1553
+  bundle2-input-part: total payload size 24
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
@@ -1509,13 +1506,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1551,21 +1547,15 @@ 
   acl: branch access granted: "e8fc755d4d82" on branch "foobar"
   acl: path access granted: "e8fc755d4d82"
   bundle2-input-part: total payload size 2068
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 3 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 2 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 2 (undo push)
   2:fb35475503ef
@@ -1600,13 +1590,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1641,7 +1630,8 @@ 
   acl: path access granted: "911600dab2ae"
   error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
   bundle2-input-part: total payload size 2068
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
   abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
@@ -1677,13 +1667,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1712,7 +1701,8 @@ 
   acl: acl.deny not enabled
   error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
   bundle2-input-part: total payload size 2068
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
   abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
@@ -1750,13 +1740,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1785,7 +1774,8 @@ 
   acl: acl.deny not enabled
   error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
   bundle2-input-part: total payload size 2068
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
   abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
@@ -1817,13 +1807,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1859,21 +1848,15 @@ 
   acl: branch access granted: "e8fc755d4d82" on branch "foobar"
   acl: path access granted: "e8fc755d4d82"
   bundle2-input-part: total payload size 2068
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 3 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 2 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 2 (undo push)
   2:fb35475503ef
@@ -1913,13 +1896,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -1955,21 +1937,15 @@ 
   acl: branch access granted: "e8fc755d4d82" on branch "foobar"
   acl: path access granted: "e8fc755d4d82"
   bundle2-input-part: total payload size 2068
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 3 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 2 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 2 (undo push)
   2:fb35475503ef
@@ -2008,13 +1984,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -2043,7 +2018,8 @@ 
   acl: acl.deny not enabled
   error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
   bundle2-input-part: total payload size 2068
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
   abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
@@ -2080,13 +2056,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -2122,21 +2097,15 @@ 
   acl: branch access granted: "e8fc755d4d82" on branch "foobar"
   acl: path access granted: "e8fc755d4d82"
   bundle2-input-part: total payload size 2068
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   updating the branch cache
-  bundle2-output-bundle: "HG20", 3 parts total
+  bundle2-output-bundle: "HG20", 1 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input-bundle: 2 parts total
+  bundle2-input-bundle: 0 parts total
   listing keys for "phases"
   repository tip rolled back to revision 2 (undo push)
   2:fb35475503ef
@@ -2169,13 +2138,12 @@ 
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
   911600dab2ae7a9baff75958b84fe606851ce955
   e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
-  bundle2-output-bundle: "HG20", 6 parts total
+  bundle2-output-bundle: "HG20", 5 parts total
   bundle2-output-part: "replycaps" 168 bytes payload
   bundle2-output-part: "check:phases" 48 bytes payload
   bundle2-output-part: "check:heads" streamed payload
   bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+  bundle2-output-part: "phase-heads" 48 bytes payload
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "replycaps" supported
   bundle2-input-part: total payload size 168
@@ -2204,7 +2172,8 @@ 
   acl: acl.deny not enabled
   error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
   bundle2-input-part: total payload size 2068
-  bundle2-input-bundle: 5 parts total
+  bundle2-input-part: total payload size 48
+  bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
   abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t
--- a/tests/test-bundle2-exchange.t
+++ b/tests/test-bundle2-exchange.t
@@ -252,9 +252,6 @@ 
   remote: added 1 changesets with 0 changes to 0 files (-1 heads)
   remote: 1 new obsolescence markers
   remote: pre-close-tip:eea13746799a public book_eea1
-  remote: pushkey: lock state after "phases"
-  remote: lock:  free
-  remote: wlock: free
   remote: pushkey: lock state after "bookmarks"
   remote: lock:  free
   remote: wlock: free
@@ -392,9 +389,6 @@ 
   remote: added 1 changesets with 1 changes to 1 files
   remote: 1 new obsolescence markers
   remote: pre-close-tip:32af7686d403 public book_32af
-  remote: pushkey: lock state after "phases"
-  remote: lock:  free
-  remote: wlock: free
   remote: pushkey: lock state after "bookmarks"
   remote: lock:  free
   remote: wlock: free
diff --git a/tests/test-push-http.t b/tests/test-push-http.t
--- a/tests/test-push-http.t
+++ b/tests/test-push-http.t
@@ -70,7 +70,6 @@ 
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
@@ -89,7 +88,6 @@ 
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
@@ -108,7 +106,6 @@ 
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: pushkey hook: HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> 0
   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
@@ -124,6 +121,8 @@ 
   > allow_push = *
   > [hooks]
   > prepushkey = sh -c "printenv.py prepushkey 1"
+  > [devel]
+  > legacy.exchange=phases
   > EOF
   $ req
   pushing to http://localhost:$HGPORT/
@@ -144,6 +143,8 @@ 
 
   $ cat >> .hg/hgrc <<EOF
   > prepushkey = sh -c "printenv.py prepushkey 0"
+  > [devel]
+  > legacy.exchange=
   > EOF
   $ req
   pushing to http://localhost:$HGPORT/
@@ -152,7 +153,6 @@ 
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)