[PATCH 3 of 6 REPHASE-VIEW] phases: add basic pushkey support

Matt Mackall mpm at selenic.com
Wed Oct 26 11:37:56 CDT 2011


On Wed, 2011-10-26 at 14:56 +0200, pierre-yves.david at logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1319632430 -7200
> # Node ID 2e3bd3b14829703f74299257f466b6f16897bd3d
> # Parent  528fa15037b1386f4cd09eedca80f43f0c41d1bf
> phases: add basic pushkey support
> 
> diff --git a/mercurial/phases.py b/mercurial/phases.py
> --- a/mercurial/phases.py
> +++ b/mercurial/phases.py
> @@ -65,5 +65,37 @@ def moveboundary(repo, phase, nodes):
>                  moveboundary(repo, phase + 1, nodes) # cascading
>                  # invalidate cache (we probably could be smarter here
>                  if '_phaserev' in vars(repo):
>                      del repo._phaserev
>                  repo._dirtyphases = True
> +
> +def listphaseroots(repo):
> +    """List phases root for serialisation over pushkey"""
> +    if repo.ui.configbool('phases', 'publish', True):
> +        return {}
> +    else:
> +        keys = {}
> +        # reminder for rewriting when adding secret
> +        assert len(trackedphases) ==1
> +        assert len(allphases) == 2
> +        for phase in trackedphases[::-1]:
> +            for root in repo.set('roots(not ::%ln)', repo._phaseheads[phase]):
> +                keys[root.hex()] = phase+1
> +    return keys
> +def pushphaseroot(repo, key, oldphase, newphase):

Missing newline.

> +    """List phases heads for serialisation over pushkey"""
> +    raise NotImplementedError('No consumer for this yet')
> +
> +
> +

Two extra newlines.

I don't know how this is going to work when you add another phase. I
think 'liquid' and 'secret' are going to need different listkey
namespaces.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list