Show More
@@ -21,7 +21,7 b' propertycache = util.propertycache' | |||||
21 | class localrepository(repo.repository): |
|
21 | class localrepository(repo.repository): | |
22 | capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey', |
|
22 | capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey', | |
23 | 'known', 'getbundle')) |
|
23 | 'known', 'getbundle')) | |
24 |
supportedformats = set(('revlogv1', |
|
24 | supportedformats = set(('revlogv1',)) | |
25 | supported = supportedformats | set(('store', 'fncache', 'shared', |
|
25 | supported = supportedformats | set(('store', 'fncache', 'shared', | |
26 | 'dotencode')) |
|
26 | 'dotencode')) | |
27 |
|
27 | |||
@@ -61,8 +61,6 b' class localrepository(repo.repository):' | |||||
61 | '\0\0\0\2' # represents revlogv2 |
|
61 | '\0\0\0\2' # represents revlogv2 | |
62 | ' dummy changelog to prevent using the old repo layout' |
|
62 | ' dummy changelog to prevent using the old repo layout' | |
63 | ) |
|
63 | ) | |
64 | if self.ui.configbool('format', 'parentdelta', False): |
|
|||
65 | requirements.append("parentdelta") |
|
|||
66 | else: |
|
64 | else: | |
67 | raise error.RepoError(_("repository %s not found") % path) |
|
65 | raise error.RepoError(_("repository %s not found") % path) | |
68 | elif create: |
|
66 | elif create: | |
@@ -117,8 +115,6 b' class localrepository(repo.repository):' | |||||
117 | def _applyrequirements(self, requirements): |
|
115 | def _applyrequirements(self, requirements): | |
118 | self.requirements = requirements |
|
116 | self.requirements = requirements | |
119 | self.sopener.options = {} |
|
117 | self.sopener.options = {} | |
120 | if 'parentdelta' in requirements: |
|
|||
121 | self.sopener.options['parentdelta'] = 1 |
|
|||
122 |
|
118 | |||
123 | def _writerequirements(self): |
|
119 | def _writerequirements(self): | |
124 | reqfile = self.opener("requires", "w") |
|
120 | reqfile = self.opener("requires", "w") |
@@ -34,9 +34,8 b' REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_' | |||||
34 | REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW |
|
34 | REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW | |
35 |
|
35 | |||
36 | # revlog index flags |
|
36 | # revlog index flags | |
37 | REVIDX_PARENTDELTA = 1 |
|
|||
38 | REVIDX_PUNCHED_FLAG = 2 |
|
37 | REVIDX_PUNCHED_FLAG = 2 | |
39 |
REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG |
|
38 | REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG | |
40 |
|
39 | |||
41 | # max size of revlog with inline data |
|
40 | # max size of revlog with inline data | |
42 | _maxinline = 131072 |
|
41 | _maxinline = 131072 | |
@@ -223,7 +222,6 b' class revlog(object):' | |||||
223 | self._chunkcache = (0, '') |
|
222 | self._chunkcache = (0, '') | |
224 | self.index = [] |
|
223 | self.index = [] | |
225 | self._shallowroot = shallowroot |
|
224 | self._shallowroot = shallowroot | |
226 | self._parentdelta = 0 |
|
|||
227 | self._pcache = {} |
|
225 | self._pcache = {} | |
228 | self._nodecache = {nullid: nullrev} |
|
226 | self._nodecache = {nullid: nullrev} | |
229 | self._nodepos = None |
|
227 | self._nodepos = None | |
@@ -233,8 +231,6 b' class revlog(object):' | |||||
233 | v = opener.options['defversion'] |
|
231 | v = opener.options['defversion'] | |
234 | if v & REVLOGNG: |
|
232 | if v & REVLOGNG: | |
235 | v |= REVLOGNGINLINEDATA |
|
233 | v |= REVLOGNGINLINEDATA | |
236 | if v & REVLOGNG and 'parentdelta' in opener.options: |
|
|||
237 | self._parentdelta = 1 |
|
|||
238 |
|
234 | |||
239 | if shallowroot: |
|
235 | if shallowroot: | |
240 | v |= REVLOGSHALLOW |
|
236 | v |= REVLOGSHALLOW | |
@@ -834,11 +830,8 b' class revlog(object):' | |||||
834 | self._chunkcache = (0, '') |
|
830 | self._chunkcache = (0, '') | |
835 |
|
831 | |||
836 | def deltaparent(self, rev): |
|
832 | def deltaparent(self, rev): | |
837 | """return previous revision or parentrev according to flags""" |
|
833 | """return deltaparent of the given revision""" | |
838 | if self.flags(rev) & REVIDX_PARENTDELTA: |
|
834 | return rev - 1 | |
839 | return self.parentrevs(rev)[0] |
|
|||
840 | else: |
|
|||
841 | return rev - 1 |
|
|||
842 |
|
835 | |||
843 | def revdiff(self, rev1, rev2): |
|
836 | def revdiff(self, rev1, rev2): | |
844 | """return or calculate a delta between two revisions""" |
|
837 | """return or calculate a delta between two revisions""" | |
@@ -870,16 +863,10 b' class revlog(object):' | |||||
870 |
|
863 | |||
871 | # build delta chain |
|
864 | # build delta chain | |
872 | chain = [] |
|
865 | chain = [] | |
873 | index = self.index # for performance |
|
|||
874 | iterrev = rev |
|
866 | iterrev = rev | |
875 | e = index[iterrev] |
|
|||
876 | while iterrev != base and iterrev != cachedrev: |
|
867 | while iterrev != base and iterrev != cachedrev: | |
877 | chain.append(iterrev) |
|
868 | chain.append(iterrev) | |
878 | if e[0] & REVIDX_PARENTDELTA: |
|
869 | iterrev -= 1 | |
879 | iterrev = e[5] |
|
|||
880 | else: |
|
|||
881 | iterrev -= 1 |
|
|||
882 | e = index[iterrev] |
|
|||
883 | chain.reverse() |
|
870 | chain.reverse() | |
884 | base = iterrev |
|
871 | base = iterrev | |
885 |
|
872 | |||
@@ -1018,11 +1005,6 b' class revlog(object):' | |||||
1018 | # should we try to build a delta? |
|
1005 | # should we try to build a delta? | |
1019 | if prev != nullrev: |
|
1006 | if prev != nullrev: | |
1020 | d = builddelta(prev) |
|
1007 | d = builddelta(prev) | |
1021 | if self._parentdelta and prev != p1r: |
|
|||
1022 | d2 = builddelta(p1r) |
|
|||
1023 | if d2 < d: |
|
|||
1024 | d = d2 |
|
|||
1025 | flags = REVIDX_PARENTDELTA |
|
|||
1026 | dist, l, data, base = d |
|
1008 | dist, l, data, base = d | |
1027 |
|
1009 | |||
1028 | # full versions are inserted when the needed deltas |
|
1010 | # full versions are inserted when the needed deltas |
General Comments 0
You need to be logged in to leave comments.
Login now