mercurial/upgrade.py
changeset 42136 10a6725dca6e
parent 42046 4ee906aa7b60
child 42137 d086ba387ae8
equal deleted inserted replaced
42135:b970fece153d 42136:10a6725dca6e
   323     upgrademessage = _('revlog content will be recompressed with the new '
   323     upgrademessage = _('revlog content will be recompressed with the new '
   324                        'algorithm.')
   324                        'algorithm.')
   325 
   325 
   326     @classmethod
   326     @classmethod
   327     def fromrepo(cls, repo):
   327     def fromrepo(cls, repo):
       
   328         # we allow multiple compression engine requirement to co-exist because
       
   329         # strickly speaking, revlog seems to support mixed compression style.
       
   330         #
       
   331         # The compression used for new entries will be "the last one"
       
   332         compression = 'zlib'
   328         for req in repo.requirements:
   333         for req in repo.requirements:
   329             if req.startswith('exp-compression-'):
   334             prefix = req.startswith
   330                 return req.split('-', 2)[2]
   335             if prefix('revlog-compression-') or prefix('exp-compression-'):
   331         return 'zlib'
   336                 compression = req.split('-', 2)[2]
       
   337         return compression
   332 
   338 
   333     @classmethod
   339     @classmethod
   334     def fromconfig(cls, repo):
   340     def fromconfig(cls, repo):
   335         return repo.ui.config('format', 'revlog-compression')
   341         return repo.ui.config('format', 'revlog-compression')
   336 
   342