Show More
@@ -27,10 +27,11 b' import struct, zlib, errno' | |||||
27 | REVLOGV0 = 0 |
|
27 | REVLOGV0 = 0 | |
28 | REVLOGNG = 1 |
|
28 | REVLOGNG = 1 | |
29 | REVLOGNGINLINEDATA = (1 << 16) |
|
29 | REVLOGNGINLINEDATA = (1 << 16) | |
|
30 | REVLOGGENERALDELTA = (1 << 17) | |||
30 | REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA |
|
31 | REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA | |
31 | REVLOG_DEFAULT_FORMAT = REVLOGNG |
|
32 | REVLOG_DEFAULT_FORMAT = REVLOGNG | |
32 | REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS |
|
33 | REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS | |
33 | REVLOGNG_FLAGS = REVLOGNGINLINEDATA |
|
34 | REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGGENERALDELTA | |
34 |
|
35 | |||
35 | # revlog index flags |
|
36 | # revlog index flags | |
36 | REVIDX_KNOWN_FLAGS = 0 |
|
37 | REVIDX_KNOWN_FLAGS = 0 | |
@@ -243,6 +244,7 b' class revlog(object):' | |||||
243 |
|
244 | |||
244 | self.version = v |
|
245 | self.version = v | |
245 | self._inline = v & REVLOGNGINLINEDATA |
|
246 | self._inline = v & REVLOGNGINLINEDATA | |
|
247 | self._generaldelta = v & REVLOGGENERALDELTA | |||
246 | flags = v & ~0xFFFF |
|
248 | flags = v & ~0xFFFF | |
247 | fmt = v & 0xFFFF |
|
249 | fmt = v & 0xFFFF | |
248 | if fmt == REVLOGV0 and flags: |
|
250 | if fmt == REVLOGV0 and flags: | |
@@ -830,8 +832,11 b' class revlog(object):' | |||||
830 |
|
832 | |||
831 | def deltaparent(self, rev): |
|
833 | def deltaparent(self, rev): | |
832 | """return deltaparent of the given revision""" |
|
834 | """return deltaparent of the given revision""" | |
833 |
|
|
835 | base = self.index[rev][3] | |
|
836 | if base == rev: | |||
834 | return nullrev |
|
837 | return nullrev | |
|
838 | elif self._generaldelta: | |||
|
839 | return base | |||
835 | else: |
|
840 | else: | |
836 | return rev - 1 |
|
841 | return rev - 1 | |
837 |
|
842 | |||
@@ -865,10 +870,14 b' class revlog(object):' | |||||
865 | # build delta chain |
|
870 | # build delta chain | |
866 | chain = [] |
|
871 | chain = [] | |
867 | index = self.index # for performance |
|
872 | index = self.index # for performance | |
|
873 | generaldelta = self._generaldelta | |||
868 | iterrev = rev |
|
874 | iterrev = rev | |
869 | e = index[iterrev] |
|
875 | e = index[iterrev] | |
870 | while iterrev != e[3] and iterrev != cachedrev: |
|
876 | while iterrev != e[3] and iterrev != cachedrev: | |
871 | chain.append(iterrev) |
|
877 | chain.append(iterrev) | |
|
878 | if generaldelta: | |||
|
879 | iterrev = e[3] | |||
|
880 | else: | |||
872 | iterrev -= 1 |
|
881 | iterrev -= 1 | |
873 | e = index[iterrev] |
|
882 | e = index[iterrev] | |
874 | chain.reverse() |
|
883 | chain.reverse() |
General Comments 0
You need to be logged in to leave comments.
Login now