Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/statichttprepo.py @ 3853:c0b449154a90
switch to the .hg/store layout, fix the tests
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 01 Dec 2006 13:34:09 +0100 |
parents | 8f18e31c4441 |
children | 8c24b6fd5866 |
comparison
equal
deleted
inserted
replaced
3852:8a9a1a7e1698 | 3853:c0b449154a90 |
---|---|
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 # find requirements | 40 # find requirements |
41 try: | 41 try: |
42 requirements = self.opener("requires").read().splitlines() | 42 requirements = self.opener("requires").read().splitlines() |
43 except IOError: | 43 except IOError: |
46 for r in requirements: | 46 for r in requirements: |
47 if r not in self.supported: | 47 if r not in self.supported: |
48 raise repo.RepoError(_("requirement '%s' not supported") % r) | 48 raise repo.RepoError(_("requirement '%s' not supported") % r) |
49 | 49 |
50 # setup store | 50 # setup store |
51 self.spath = self.path | 51 if "store" in requirements: |
52 self.sopener = opener(self.spath) | 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) | |
53 | 60 |
54 self.manifest = manifest.manifest(self.sopener) | 61 self.manifest = manifest.manifest(self.sopener) |
55 self.changelog = changelog.changelog(self.sopener) | 62 self.changelog = changelog.changelog(self.sopener) |
56 self.tagscache = None | 63 self.tagscache = None |
57 self.nodetagscache = None | 64 self.nodetagscache = None |