[PATCH 3 of 4 V2] phase: add a dedicated txnclose-phase hook

Boris Feld boris.feld at octobus.net
Thu Oct 19 02:57:47 EDT 2017


On Wed, 2017-10-18 at 10:51 -0500, Kevin Bullock wrote:
> > On Oct 14, 2017, at 10:46, Boris Feld <boris.feld at octobus.net>
> > wrote:
> > 
> > # HG changeset patch
> > # User Boris Feld <boris.feld at octobus.net>
> > # Date 1507477846 -7200
> > #      Sun Oct 08 17:50:46 2017 +0200
> > # Node ID 06eeae1828afe149886e18e6b4fc8180a3803fdb
> > # Parent  e1aa5834b2423fd04b32965075e5dee2204768c2
> > # EXP-Topic b2.phases.hooks
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #              hg pull https://bitbucket.org/octobus/mercurial-deve
> > l/ -r 06eeae1828af
> > phase: add a dedicated txnclose-phase hook
> > 
> 
> [snip]
> > diff --git a/tests/test-phases.t b/tests/test-phases.t
> > --- a/tests/test-phases.t
> > +++ b/tests/test-phases.t
> > @@ -2,6 +2,8 @@
> >   $ cat >> $HGRCPATH << EOF
> > > [extensions]
> > > phasereport=$TESTDIR/testlib/ext-phase-report.py
> > 
> > +  > [hooks]
> > +  > txnclose-phase.test = echo "test-hook-close-phase:
> > \$HG_NODE:  \$HG_OLDPHASE -> \$HG_PHASE"
> > > EOF
> > 
> >   $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
> > @@ -26,6 +28,7 @@
> > 
> >   $ mkcommit A
> >   test-debug-phase: new rev 0:  x -> 1
> > +  test-hook-close-phase:
> > 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> 1
> 
> I don't think there's any other place where we expose numeric values
> for phase, and I'm not keen to start doing so now. Could you send a
> follow-up that changes these to the normal 'secret'/'draft'/'public'
> labels?

I think the pushkey hooks are using numeric values. As we might have
people migrating from pushkey hooks to new phases hooks, I think we
should keep the numeric values but send the human phase representation
in additional environment variables, like PHASESTR, OLDPHASESTR.

Also, numeric values are useful for making comparison so I think we
should keep them.

What do you think? Should I send a follow-up?

> 
> pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
> Kevin R. Bullock
> 


More information about the Mercurial-devel mailing list