Mercurial > hg-stable
comparison mercurial/localrepo.py @ 7229:7946503ec76e
introduce fncache repository layout
* adds a new entry 'fncache' to '.hg/requires' for new repos
* writes new file '.hg/store/fncache'
* hash-encodes filenames with long paths (issue839)
* encodes Windows reserved filenames (issue793)
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sun, 19 Oct 2008 19:12:07 +0200 |
parents | b71a52f101dc |
children | 9f0e52e1df77 |
comparison
equal
deleted
inserted
replaced
7228:9b72c732ed2f | 7229:7946503ec76e |
---|---|
14 import match as match_ | 14 import match as match_ |
15 import merge as merge_ | 15 import merge as merge_ |
16 | 16 |
17 class localrepository(repo.repository): | 17 class localrepository(repo.repository): |
18 capabilities = util.set(('lookup', 'changegroupsubset')) | 18 capabilities = util.set(('lookup', 'changegroupsubset')) |
19 supported = ('revlogv1', 'store') | 19 supported = ('revlogv1', 'store', 'fncache') |
20 | 20 |
21 def __init__(self, parentui, path=None, create=0): | 21 def __init__(self, parentui, path=None, create=0): |
22 repo.repository.__init__(self) | 22 repo.repository.__init__(self) |
23 self.root = os.path.realpath(path) | 23 self.root = os.path.realpath(path) |
24 self.path = os.path.join(self.root, ".hg") | 24 self.path = os.path.join(self.root, ".hg") |
33 os.mkdir(self.path) | 33 os.mkdir(self.path) |
34 requirements = ["revlogv1"] | 34 requirements = ["revlogv1"] |
35 if parentui.configbool('format', 'usestore', True): | 35 if parentui.configbool('format', 'usestore', True): |
36 os.mkdir(os.path.join(self.path, "store")) | 36 os.mkdir(os.path.join(self.path, "store")) |
37 requirements.append("store") | 37 requirements.append("store") |
38 requirements.append("fncache") | |
38 # create an invalid changelog | 39 # create an invalid changelog |
39 self.opener("00changelog.i", "a").write( | 40 self.opener("00changelog.i", "a").write( |
40 '\0\0\0\2' # represents revlogv2 | 41 '\0\0\0\2' # represents revlogv2 |
41 ' dummy changelog to prevent using the old repo layout' | 42 ' dummy changelog to prevent using the old repo layout' |
42 ) | 43 ) |