mercurial/upgrade.py
changeset 31893 165428b05fca
parent 31875 b6d792a9bd11
child 31894 9379689b6c10
equal deleted inserted replaced
31892:9e67ce5c4fd0 31893:165428b05fca
    13 
    13 
    14 from .i18n import _
    14 from .i18n import _
    15 from . import (
    15 from . import (
    16     changelog,
    16     changelog,
    17     error,
    17     error,
       
    18     localrepo,
    18     manifest,
    19     manifest,
    19     revlog,
    20     revlog,
    20     scmutil,
    21     scmutil,
    21     util,
    22     util,
    22     vfs as vfsmod,
    23     vfs as vfsmod,
   142     """Determine improvements that can be made to the repo during upgrade.
   143     """Determine improvements that can be made to the repo during upgrade.
   143 
   144 
   144     Returns a list of ``upgradeimprovement`` describing repository deficiencies
   145     Returns a list of ``upgradeimprovement`` describing repository deficiencies
   145     and optimizations.
   146     and optimizations.
   146     """
   147     """
   147     # Avoid cycle: cmdutil -> repair -> localrepo -> cmdutil
       
   148     from . import localrepo
       
   149 
       
   150     newreporeqs = localrepo.newreporequirements(repo)
   148     newreporeqs = localrepo.newreporequirements(repo)
   151 
   149 
   152     improvements = []
   150     improvements = []
   153 
   151 
   154     # We could detect lack of revlogv1 and store here, but they were added
   152     # We could detect lack of revlogv1 and store here, but they were added
   583 
   581 
   584     return backuppath
   582     return backuppath
   585 
   583 
   586 def upgraderepo(ui, repo, run=False, optimize=None):
   584 def upgraderepo(ui, repo, run=False, optimize=None):
   587     """Upgrade a repository in place."""
   585     """Upgrade a repository in place."""
   588     # Avoid cycle: cmdutil -> repair -> localrepo -> cmdutil
       
   589     from . import localrepo
       
   590 
       
   591     optimize = set(optimize or [])
   586     optimize = set(optimize or [])
   592     repo = repo.unfiltered()
   587     repo = repo.unfiltered()
   593 
   588 
   594     # Ensure the repository can be upgraded.
   589     # Ensure the repository can be upgraded.
   595     missingreqs = requiredsourcerequirements(repo) - repo.requirements
   590     missingreqs = requiredsourcerequirements(repo) - repo.requirements