mercurial/interfaces/repository.py
changeset 43077 687b865b95ad
parent 43076 2372284d9457
child 43142 beed7ce61681
equal deleted inserted replaced
43076:2372284d9457 43077:687b865b95ad
    11 from .. import error
    11 from .. import error
    12 from . import util as interfaceutil
    12 from . import util as interfaceutil
    13 
    13 
    14 # When narrowing is finalized and no longer subject to format changes,
    14 # When narrowing is finalized and no longer subject to format changes,
    15 # we should move this to just "narrow" or similar.
    15 # we should move this to just "narrow" or similar.
    16 NARROW_REQUIREMENT = 'narrowhg-experimental'
    16 NARROW_REQUIREMENT = b'narrowhg-experimental'
    17 
    17 
    18 # Local repository feature string.
    18 # Local repository feature string.
    19 
    19 
    20 # Revlogs are being used for file storage.
    20 # Revlogs are being used for file storage.
    21 REPO_FEATURE_REVLOG_FILE_STORAGE = b'revlogfilestorage'
    21 REPO_FEATURE_REVLOG_FILE_STORAGE = b'revlogfilestorage'
   350     def capable(self, name):
   350     def capable(self, name):
   351         caps = self.capabilities()
   351         caps = self.capabilities()
   352         if name in caps:
   352         if name in caps:
   353             return True
   353             return True
   354 
   354 
   355         name = '%s=' % name
   355         name = b'%s=' % name
   356         for cap in caps:
   356         for cap in caps:
   357             if cap.startswith(name):
   357             if cap.startswith(name):
   358                 return cap[len(name) :]
   358                 return cap[len(name) :]
   359 
   359 
   360         return False
   360         return False
   363         if self.capable(name):
   363         if self.capable(name):
   364             return
   364             return
   365 
   365 
   366         raise error.CapabilityError(
   366         raise error.CapabilityError(
   367             _(
   367             _(
   368                 'cannot %s; remote repository does not support the '
   368                 b'cannot %s; remote repository does not support the '
   369                 '\'%s\' capability'
   369                 b'\'%s\' capability'
   370             )
   370             )
   371             % (purpose, name)
   371             % (purpose, name)
   372         )
   372         )
   373 
   373 
   374 
   374 
  1023         """
  1023         """
  1024 
  1024 
  1025     def get(path, default=None):
  1025     def get(path, default=None):
  1026         """Obtain the node value for a path or a default value if missing."""
  1026         """Obtain the node value for a path or a default value if missing."""
  1027 
  1027 
  1028     def flags(path, default=''):
  1028     def flags(path, default=b''):
  1029         """Return the flags value for a path or a default value if missing."""
  1029         """Return the flags value for a path or a default value if missing."""
  1030 
  1030 
  1031     def copy():
  1031     def copy():
  1032         """Return a copy of this manifest."""
  1032         """Return a copy of this manifest."""
  1033 
  1033 
  1744 
  1744 
  1745     def checkcommitpatterns(wctx, vdirs, match, status, fail):
  1745     def checkcommitpatterns(wctx, vdirs, match, status, fail):
  1746         pass
  1746         pass
  1747 
  1747 
  1748     def commit(
  1748     def commit(
  1749         text='',
  1749         text=b'',
  1750         user=None,
  1750         user=None,
  1751         date=None,
  1751         date=None,
  1752         match=None,
  1752         match=None,
  1753         force=False,
  1753         force=False,
  1754         editor=False,
  1754         editor=False,
  1764 
  1764 
  1765     def destroyed():
  1765     def destroyed():
  1766         """Inform the repository that nodes have been destroyed."""
  1766         """Inform the repository that nodes have been destroyed."""
  1767 
  1767 
  1768     def status(
  1768     def status(
  1769         node1='.',
  1769         node1=b'.',
  1770         node2=None,
  1770         node2=None,
  1771         match=None,
  1771         match=None,
  1772         ignored=False,
  1772         ignored=False,
  1773         clean=False,
  1773         clean=False,
  1774         unknown=False,
  1774         unknown=False,