Mercurial > hg
comparison mercurial/localrepo.py @ 14333:31a5973fcf96
revlog: get rid of defversion
defversion was a property (later option) on the store opener, used to propagate
the changelog revlog format to the other revlogs, so they would be created with
the same format.
This required that the changelog instance was created before any other revlog;
an invariant that wasn't directly enforced (or documented) anywhere.
We now use the revlogv1 requirement instead, which is transfered to the store
opener options. If this option is missing, v0 revlogs are created.
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Mon, 16 May 2011 12:44:34 +0200 |
parents | 01472f8f5429 |
children | 82f3b0f3f0a5 |
comparison
equal
deleted
inserted
replaced
14332:a2f0f61a6988 | 14333:31a5973fcf96 |
---|---|
114 self._datafilters = {} | 114 self._datafilters = {} |
115 self._transref = self._lockref = self._wlockref = None | 115 self._transref = self._lockref = self._wlockref = None |
116 | 116 |
117 def _applyrequirements(self, requirements): | 117 def _applyrequirements(self, requirements): |
118 self.requirements = requirements | 118 self.requirements = requirements |
119 self.sopener.options = {} | 119 openerreqs = set(('revlogv1', 'generaldelta')) |
120 if 'generaldelta' in requirements: | 120 self.sopener.options = dict((r, 1) for r in requirements |
121 self.sopener.options['generaldelta'] = 1 | 121 if r in openerreqs) |
122 | 122 |
123 def _writerequirements(self): | 123 def _writerequirements(self): |
124 reqfile = self.opener("requires", "w") | 124 reqfile = self.opener("requires", "w") |
125 for r in self.requirements: | 125 for r in self.requirements: |
126 reqfile.write("%s\n" % r) | 126 reqfile.write("%s\n" % r) |
176 c = changelog.changelog(self.sopener) | 176 c = changelog.changelog(self.sopener) |
177 if 'HG_PENDING' in os.environ: | 177 if 'HG_PENDING' in os.environ: |
178 p = os.environ['HG_PENDING'] | 178 p = os.environ['HG_PENDING'] |
179 if p.startswith(self.root): | 179 if p.startswith(self.root): |
180 c.readpending('00changelog.i.a') | 180 c.readpending('00changelog.i.a') |
181 self.sopener.options['defversion'] = c.version | |
182 return c | 181 return c |
183 | 182 |
184 @propertycache | 183 @propertycache |
185 def manifest(self): | 184 def manifest(self): |
186 return manifest.manifest(self.sopener) | 185 return manifest.manifest(self.sopener) |