Patchwork [3,of,4] phases: add a repository requirement about internal phase

login
register
mail settings
Submitter Boris Feld
Date Aug. 27, 2018, 10:39 a.m.
Message ID <e4923ad20f3367679065.1535366395@FB-lair>
Download mbox | patch
Permalink /patch/34078/
State Accepted
Headers show

Comments

Boris Feld - Aug. 27, 2018, 10:39 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1527148750 -7200
#      Thu May 24 09:59:10 2018 +0200
# Node ID e4923ad20f33676790657ac8e3f088180d1312d4
# Parent  de8fadb2459129a8ee097d2a8cadb23ee02473c7
# EXP-Topic internal-phase.new-phase
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r e4923ad20f33
phases: add a repository requirement about internal phase

For internal changeset to be properly hidden, the client version needs to
support it. So we introduce a new repository requirement that will make sure
clients touching a repository that uses internal phase supports the feature.
Gregory Szorc - Aug. 28, 2018, 11:04 p.m.
On Mon, Aug 27, 2018 at 3:41 AM Boris Feld <boris.feld@octobus.net> wrote:

> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1527148750 -7200
> #      Thu May 24 09:59:10 2018 +0200
> # Node ID e4923ad20f33676790657ac8e3f088180d1312d4
> # Parent  de8fadb2459129a8ee097d2a8cadb23ee02473c7
> # EXP-Topic internal-phase.new-phase
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> e4923ad20f33
> phases: add a repository requirement about internal phase
>

Please send a follow-up that documents the new requirement in
mercurial/help/internals/requirements.txt.


>
> For internal changeset to be properly hidden, the client version needs to
> support it. So we introduce a new repository requirement that will make
> sure
> clients touching a repository that uses internal phase supports the
> feature.
>
> diff --git a/mercurial/configitems.py b/mercurial/configitems.py
> --- a/mercurial/configitems.py
> +++ b/mercurial/configitems.py
> @@ -679,6 +679,9 @@ coreconfigitem('format', 'usegeneraldelt
>  coreconfigitem('format', 'usestore',
>      default=True,
>  )
> +coreconfigitem('format', 'internal-phase',
> +    default=False,
> +)
>  coreconfigitem('fsmonitor', 'warn_when_unused',
>      default=True,
>  )
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -394,6 +394,7 @@ class localrepository(object):
>          'relshared',
>          'dotencode',
>          'exp-sparse',
> +        'internal-phase'
>      }
>      openerreqs = {
>          'revlogv1',
> @@ -2427,5 +2428,8 @@ def newreporequirements(repo):
>          # generaldelta is implied by revlogv2.
>          requirements.discard('generaldelta')
>          requirements.add(REVLOGV2_REQUIREMENT)
> +    # experimental config: format.internal-phase
> +    if repo.ui.configbool('format', 'internal-phase'):
> +        requirements.add('internal-phase')
>
>      return requirements
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -679,6 +679,9 @@  coreconfigitem('format', 'usegeneraldelt
 coreconfigitem('format', 'usestore',
     default=True,
 )
+coreconfigitem('format', 'internal-phase',
+    default=False,
+)
 coreconfigitem('fsmonitor', 'warn_when_unused',
     default=True,
 )
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -394,6 +394,7 @@  class localrepository(object):
         'relshared',
         'dotencode',
         'exp-sparse',
+        'internal-phase'
     }
     openerreqs = {
         'revlogv1',
@@ -2427,5 +2428,8 @@  def newreporequirements(repo):
         # generaldelta is implied by revlogv2.
         requirements.discard('generaldelta')
         requirements.add(REVLOGV2_REQUIREMENT)
+    # experimental config: format.internal-phase
+    if repo.ui.configbool('format', 'internal-phase'):
+        requirements.add('internal-phase')
 
     return requirements