mercurial/statichttprepo.py
changeset 3854 4f6db0233606
parent 3853 c0b449154a90
child 3859 8c24b6fd5866
equal deleted inserted replaced
3848:8cbf060f637e 3854:4f6db0233606
    30     return o
    30     return o
    31 
    31 
    32 class statichttprepository(localrepo.localrepository):
    32 class statichttprepository(localrepo.localrepository):
    33     def __init__(self, ui, path):
    33     def __init__(self, ui, path):
    34         self._url = path
    34         self._url = path
    35         self.path = (path + "/.hg")
       
    36         self.spath = self.path
       
    37         self.ui = ui
    35         self.ui = ui
    38         self.revlogversion = 0
    36         self.revlogversion = 0
       
    37 
       
    38         self.path = (path + "/.hg")
    39         self.opener = opener(self.path)
    39         self.opener = opener(self.path)
    40         self.sopener = opener(self.spath)
    40         # find requirements
       
    41         try:
       
    42             requirements = self.opener("requires").read().splitlines()
       
    43         except IOError:
       
    44             requirements = []
       
    45         # check them
       
    46         for r in requirements:
       
    47             if r not in self.supported:
       
    48                 raise repo.RepoError(_("requirement '%s' not supported") % r)
       
    49 
       
    50         # setup store
       
    51         if "store" in requirements:
       
    52             self.encodefn = util.encodefilename
       
    53             self.decodefn = util.decodefilename
       
    54             self.spath = self.path + "/store"
       
    55         else:
       
    56             self.encodefn = lambda x: x
       
    57             self.decodefn = lambda x: x
       
    58             self.spath = self.path
       
    59         self.sopener = util.encodedopener(opener(self.spath), self.encodefn)
       
    60 
    41         self.manifest = manifest.manifest(self.sopener)
    61         self.manifest = manifest.manifest(self.sopener)
    42         self.changelog = changelog.changelog(self.sopener)
    62         self.changelog = changelog.changelog(self.sopener)
    43         self.tagscache = None
    63         self.tagscache = None
    44         self.nodetagscache = None
    64         self.nodetagscache = None
    45         self.encodepats = None
    65         self.encodepats = None