partial publish on push

Anton Shestakov av6 at dwimlabs.net
Fri Aug 11 19:28:30 UTC 2023


11.08.2023 11:37, Josef 'Jeff' Sipek пишет:
> On Fri, Aug 11, 2023 at 17:32:40 +0300, Mitchell Elutovich wrote:
>> As discussed, to turn off the auto publishing of changesets that are
>> pushed, the target repo needs to be defined with phases.publish=false.
>>
>> We only partially want that behavior.
> 
> I haven't followed the discussion in detail, so maybe this wouldn't work for
> some other reason, but couldn't you set up a hook on the server that changes
> the phase to public based on whatever conditions you define in the hook?
> Any unmached changes would stay drafts thanks to phases.publish=false.

This is what I'd do too, a hook on the main dev repo. However, I can't 
say how easy it is to make sure phase changes (draft->public on the 
production branch) also propagate to the source repo during the same push.

See hg help config.hooks for how to configure it and 
https://foss.heptapod.net/mercurial/mercurial-devel/-/tree/branch/default/hgext/hooklib 
for examples of python hooks. Shell hooks can also publish only commits 
on a specific branch, but I don't think they can see the new commits 
unless the transaction is already closed and client is disconnected (and 
cannot receive phase information).

So to elaborate, if client hg receives no updates about phases during 
push, it won't publish them locally. Only during the next exchange it 
would update the phases in the local repo. Since overall the main dev 
repo is going to be non-publishing and we're trying to publish only 
specific things there, it needs to happen while transaction is still 
open and the client didn't receive the final response yet. That probably 
means a hook in python or a server-side extension.


More information about the Evolve-testers mailing list