Show More
@@ -11,6 +11,8 b'' | |||||
11 | allowing operations like diff and log with revsets. |
|
11 | allowing operations like diff and log with revsets. | |
12 | """ |
|
12 | """ | |
13 |
|
13 | |||
|
14 | import contextlib | |||
|
15 | ||||
14 |
|
16 | |||
15 | from .i18n import _ |
|
17 | from .i18n import _ | |
16 |
|
18 | |||
@@ -112,6 +114,19 b' class unionrevlog(revlog.revlog):' | |||||
112 | self.bundlerevs.add(n) |
|
114 | self.bundlerevs.add(n) | |
113 | n += 1 |
|
115 | n += 1 | |
114 |
|
116 | |||
|
117 | @contextlib.contextmanager | |||
|
118 | def reading(self): | |||
|
119 | if 0 <= len(self.bundlerevs) < len(self.index): | |||
|
120 | read_1 = super().reading | |||
|
121 | else: | |||
|
122 | read_1 = util.nullcontextmanager | |||
|
123 | if 0 < len(self.bundlerevs): | |||
|
124 | read_2 = self.revlog2.reading | |||
|
125 | else: | |||
|
126 | read_2 = util.nullcontextmanager | |||
|
127 | with read_1(), read_2(): | |||
|
128 | yield | |||
|
129 | ||||
115 | def _chunk(self, rev, df=None): |
|
130 | def _chunk(self, rev, df=None): | |
116 | if rev <= self.repotiprev: |
|
131 | if rev <= self.repotiprev: | |
117 | return revlog.revlog._chunk(self, rev) |
|
132 | return revlog.revlog._chunk(self, rev) |
General Comments 0
You need to be logged in to leave comments.
Login now