mercurial/filelog.py
changeset 51818 e78b75f3cea9
parent 51699 ca7bde5dbafb
child 51822 0338fb200a30
equal deleted inserted replaced
51817:c371134fef01 51818:e78b75f3cea9
     3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
     3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
     4 #
     4 #
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
       
     8 
       
     9 import typing
     8 
    10 
     9 from .i18n import _
    11 from .i18n import _
    10 from .node import nullrev
    12 from .node import nullrev
    11 from . import (
    13 from . import (
    12     error,
    14     error,
    21     constants as revlog_constants,
    23     constants as revlog_constants,
    22     rewrite,
    24     rewrite,
    23 )
    25 )
    24 
    26 
    25 
    27 
    26 @interfaceutil.implementer(repository.ifilestorage)
    28 class FileLog:
    27 class filelog:
       
    28     def __init__(self, opener, path, try_split=False):
    29     def __init__(self, opener, path, try_split=False):
    29         self._revlog = revlog.revlog(
    30         self._revlog = revlog.revlog(
    30             opener,
    31             opener,
    31             # XXX should use the unencoded path
    32             # XXX should use the unencoded path
    32             target=(revlog_constants.KIND_FILELOG, path),
    33             target=(revlog_constants.KIND_FILELOG, path),
   260             raise error.ProgrammingError(msg)
   261             raise error.ProgrammingError(msg)
   261 
   262 
   262         return self._revlog.clone(tr, destrevlog._revlog, **kwargs)
   263         return self._revlog.clone(tr, destrevlog._revlog, **kwargs)
   263 
   264 
   264 
   265 
       
   266 filelog = interfaceutil.implementer(repository.ifilestorage)(FileLog)
       
   267 
       
   268 if typing.TYPE_CHECKING:
       
   269     filelog = FileLog
       
   270 
       
   271 
   265 class narrowfilelog(filelog):
   272 class narrowfilelog(filelog):
   266     """Filelog variation to be used with narrow stores."""
   273     """Filelog variation to be used with narrow stores."""
   267 
   274 
   268     def __init__(self, opener, path, narrowmatch, try_split=False):
   275     def __init__(self, opener, path, narrowmatch, try_split=False):
   269         super(narrowfilelog, self).__init__(opener, path, try_split=try_split)
   276         super(narrowfilelog, self).__init__(opener, path, try_split=try_split)