hgext/narrow/__init__.py
changeset 43077 687b865b95ad
parent 43076 2372284d9457
child 43966 f91834ecfdfd
equal deleted inserted replaced
43076:2372284d9457 43077:687b865b95ad
    10 
    10 
    11 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
    11 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
    12 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    12 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    13 # be specifying the version(s) of Mercurial they are tested with, or
    13 # be specifying the version(s) of Mercurial they are tested with, or
    14 # leave the attribute unspecified.
    14 # leave the attribute unspecified.
    15 testedwith = 'ships-with-hg-core'
    15 testedwith = b'ships-with-hg-core'
    16 
    16 
    17 from mercurial import (
    17 from mercurial import (
    18     localrepo,
    18     localrepo,
    19     registrar,
    19     registrar,
    20 )
    20 )
    39 # repositories with merges, it's unlikely this work will get done. As
    39 # repositories with merges, it's unlikely this work will get done. As
    40 # of this writining in late 2017, all repositories large enough for
    40 # of this writining in late 2017, all repositories large enough for
    41 # ellipsis nodes to be a hard requirement also enforce strictly linear
    41 # ellipsis nodes to be a hard requirement also enforce strictly linear
    42 # history for other scaling reasons.
    42 # history for other scaling reasons.
    43 configitem(
    43 configitem(
    44     'experimental',
    44     b'experimental',
    45     'narrowservebrokenellipses',
    45     b'narrowservebrokenellipses',
    46     default=False,
    46     default=False,
    47     alias=[('narrow', 'serveellipses')],
    47     alias=[(b'narrow', b'serveellipses')],
    48 )
    48 )
    49 
    49 
    50 # Export the commands table for Mercurial to see.
    50 # Export the commands table for Mercurial to see.
    51 cmdtable = narrowcommands.table
    51 cmdtable = narrowcommands.table
    52 
    52 
    66 def reposetup(ui, repo):
    66 def reposetup(ui, repo):
    67     """Wraps local repositories with narrow repo support."""
    67     """Wraps local repositories with narrow repo support."""
    68     if not repo.local():
    68     if not repo.local():
    69         return
    69         return
    70 
    70 
    71     repo.ui.setconfig('experimental', 'narrow', True, 'narrow-ext')
    71     repo.ui.setconfig(b'experimental', b'narrow', True, b'narrow-ext')
    72     if repository.NARROW_REQUIREMENT in repo.requirements:
    72     if repository.NARROW_REQUIREMENT in repo.requirements:
    73         narrowrepo.wraprepo(repo)
    73         narrowrepo.wraprepo(repo)
    74         narrowwirepeer.reposetup(repo)
    74         narrowwirepeer.reposetup(repo)
    75 
    75 
    76 
    76