Mercurial > hg
comparison mercurial/bundlerepo.py @ 51026:8520db304f01
revlog: drop more file description passing between private function
They are no longer used as we are covered by the `reading` context
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 26 Sep 2023 02:54:50 +0200 |
parents | 3470a39fb66b |
children | f70ce1aedbcb |
comparison
equal
deleted
inserted
replaced
51025:9011c38b4f65 | 51026:8520db304f01 |
---|---|
115 yield | 115 yield |
116 else: | 116 else: |
117 with super().reading() as x: | 117 with super().reading() as x: |
118 yield x | 118 yield x |
119 | 119 |
120 def _chunk(self, rev, df=None): | 120 def _chunk(self, rev): |
121 # Warning: in case of bundle, the diff is against what we stored as | 121 # Warning: in case of bundle, the diff is against what we stored as |
122 # delta base, not against rev - 1 | 122 # delta base, not against rev - 1 |
123 # XXX: could use some caching | 123 # XXX: could use some caching |
124 if rev <= self.repotiprev: | 124 if rev <= self.repotiprev: |
125 return revlog.revlog._chunk(self, rev) | 125 return revlog.revlog._chunk(self, rev) |
136 elif rev1 <= self.repotiprev and rev2 <= self.repotiprev: | 136 elif rev1 <= self.repotiprev and rev2 <= self.repotiprev: |
137 return revlog.revlog.revdiff(self, rev1, rev2) | 137 return revlog.revlog.revdiff(self, rev1, rev2) |
138 | 138 |
139 return mdiff.textdiff(self.rawdata(rev1), self.rawdata(rev2)) | 139 return mdiff.textdiff(self.rawdata(rev1), self.rawdata(rev2)) |
140 | 140 |
141 def _rawtext(self, node, rev, _df=None): | 141 def _rawtext(self, node, rev): |
142 if rev is None: | 142 if rev is None: |
143 rev = self.rev(node) | 143 rev = self.rev(node) |
144 validated = False | 144 validated = False |
145 rawtext = None | 145 rawtext = None |
146 chain = [] | 146 chain = [] |
154 iterrev = self.index[iterrev][3] | 154 iterrev = self.index[iterrev][3] |
155 if iterrev == nullrev: | 155 if iterrev == nullrev: |
156 rawtext = b'' | 156 rawtext = b'' |
157 elif rawtext is None: | 157 elif rawtext is None: |
158 r = super(bundlerevlog, self)._rawtext( | 158 r = super(bundlerevlog, self)._rawtext( |
159 self.node(iterrev), iterrev, _df=_df | 159 self.node(iterrev), |
160 iterrev, | |
160 ) | 161 ) |
161 __, rawtext, validated = r | 162 __, rawtext, validated = r |
162 if chain: | 163 if chain: |
163 validated = False | 164 validated = False |
164 while chain: | 165 while chain: |