Re: [PATCH 7 of 8 V2] phase: isolate logic to update remote phrase through bundle2 pushkey

2017-10-19 Thread Boris Feld
On Thu, 2017-10-19 at 22:30 +0900, Yuya Nishihara wrote:
> On Mon, 16 Oct 2017 20:23:48 +0200, Boris Feld wrote:
> > # HG changeset patch
> > # User Boris Feld 
> > # Date 1505927857 -7200
> > #  Wed Sep 20 19:17:37 2017 +0200
> > # Node ID 9c084f14df72a2d511d414e0ecf50a086c0a2341
> > # Parent  e688d8b13100c464897c7f872c498202f8e82272
> > # EXP-Topic b2.phases.push
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull https://bitbucket.org/octobus/mercurial-deve
> > l/ -r 9c084f14df72
> > phase: isolate logic to update remote phrase through bundle2
> > pushkey
> > 
> > Move the logic to build bundle2 pushkey part into its dedicated
> > function. It
> > will help to keep the logic clear when adding support for sending
> > phases change
> > using 'phase-heads' part.
> > 
> > diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> > --- a/mercurial/exchange.py
> > +++ b/mercurial/exchange.py
> > @@ -806,8 +806,11 @@
> >  if 'phases' in pushop.stepsdone:
> >  return
> >  b2caps = bundle2.bundle2caps(pushop.remote)
> > -if not 'pushkey' in b2caps:
> > -return
> > +if 'pushkey' in b2caps:
> > +_pushb2phasespushkey(pushop, bundler)
> 
> Don't we need to return the handlereply function?

Yes good catch, we will send a follow-up.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 7 of 8 V2] phase: isolate logic to update remote phrase through bundle2 pushkey

2017-10-19 Thread Yuya Nishihara
On Mon, 16 Oct 2017 20:23:48 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1505927857 -7200
> #  Wed Sep 20 19:17:37 2017 +0200
> # Node ID 9c084f14df72a2d511d414e0ecf50a086c0a2341
> # Parent  e688d8b13100c464897c7f872c498202f8e82272
> # EXP-Topic b2.phases.push
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 9c084f14df72
> phase: isolate logic to update remote phrase through bundle2 pushkey
> 
> Move the logic to build bundle2 pushkey part into its dedicated function. It
> will help to keep the logic clear when adding support for sending phases 
> change
> using 'phase-heads' part.
> 
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -806,8 +806,11 @@
>  if 'phases' in pushop.stepsdone:
>  return
>  b2caps = bundle2.bundle2caps(pushop.remote)
> -if not 'pushkey' in b2caps:
> -return
> +if 'pushkey' in b2caps:
> +_pushb2phasespushkey(pushop, bundler)

Don't we need to return the handlereply function?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 7 of 8 V2] phase: isolate logic to update remote phrase through bundle2 pushkey

2017-10-16 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1505927857 -7200
#  Wed Sep 20 19:17:37 2017 +0200
# Node ID 9c084f14df72a2d511d414e0ecf50a086c0a2341
# Parent  e688d8b13100c464897c7f872c498202f8e82272
# EXP-Topic b2.phases.push
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
9c084f14df72
phase: isolate logic to update remote phrase through bundle2 pushkey

Move the logic to build bundle2 pushkey part into its dedicated function. It
will help to keep the logic clear when adding support for sending phases change
using 'phase-heads' part.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -806,8 +806,11 @@
 if 'phases' in pushop.stepsdone:
 return
 b2caps = bundle2.bundle2caps(pushop.remote)
-if not 'pushkey' in b2caps:
-return
+if 'pushkey' in b2caps:
+_pushb2phasespushkey(pushop, bundler)
+
+def _pushb2phasespushkey(pushop, bundler):
+"""push phase information through a bundle2 - pushkey part"""
 pushop.stepsdone.add('phases')
 part2node = []
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel