##// END OF EJS Templates
unionrepo: fix mismatches with revlog classes...
Matt Harbison -
r52768:8315175f default
parent child Browse files
Show More
@@ -39,7 +39,9 from .revlogutils import (
39
39
40
40
41 class unionrevlog(revlog.revlog):
41 class unionrevlog(revlog.revlog):
42 def __init__(self, opener, radix, revlog2, linkmapper):
42 def __init__(self, opener: typing.Any, radix, revlog2, linkmapper):
43 # TODO: figure out real type of opener
44 #
43 # How it works:
45 # How it works:
44 # To retrieve a revision, we just need to know the node id so we can
46 # To retrieve a revision, we just need to know the node id so we can
45 # look it up in revlog2.
47 # look it up in revlog2.
@@ -49,6 +51,10 class unionrevlog(revlog.revlog):
49 opener = vfsmod.readonlyvfs(opener)
51 opener = vfsmod.readonlyvfs(opener)
50 target = getattr(revlog2, 'target', None)
52 target = getattr(revlog2, 'target', None)
51 if target is None:
53 if target is None:
54 # Help pytype- changelog and revlog are not possible here because
55 # they both have a 'target' attr.
56 assert not isinstance(revlog2, (changelog.changelog, revlog.revlog))
57
52 # a revlog wrapper, eg: the manifestlog that is not an actual revlog
58 # a revlog wrapper, eg: the manifestlog that is not an actual revlog
53 target = revlog2._revlog.target
59 target = revlog2._revlog.target
54 revlog.revlog.__init__(self, opener, target=target, radix=radix)
60 revlog.revlog.__init__(self, opener, target=target, radix=radix)
@@ -131,7 +137,7 class unionrevlog(revlog.revlog):
131
137
132 def _chunk(self, rev):
138 def _chunk(self, rev):
133 if rev <= self.repotiprev:
139 if rev <= self.repotiprev:
134 return revlog.revlog._chunk(self, rev)
140 return super(unionrevlog, self)._inner._chunk(rev)
135 return self.revlog2._chunk(self.node(rev))
141 return self.revlog2._chunk(self.node(rev))
136
142
137 def revdiff(self, rev1, rev2):
143 def revdiff(self, rev1, rev2):
General Comments 0
You need to be logged in to leave comments. Login now