Mercurial > hg-stable
comparison mercurial/changegroup.py @ 26707:5ee6bd529300
changegroup: mark cg1unpacker.chunklength as private
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 14 Oct 2015 11:58:56 -0400 |
parents | 8c0c3059f478 |
children | 749d913f24b8 |
comparison
equal
deleted
inserted
replaced
26706:8c0c3059f478 | 26707:5ee6bd529300 |
---|---|
194 def tell(self): | 194 def tell(self): |
195 return self._stream.tell() | 195 return self._stream.tell() |
196 def close(self): | 196 def close(self): |
197 return self._stream.close() | 197 return self._stream.close() |
198 | 198 |
199 def chunklength(self): | 199 def _chunklength(self): |
200 d = readexactly(self._stream, 4) | 200 d = readexactly(self._stream, 4) |
201 l = struct.unpack(">l", d)[0] | 201 l = struct.unpack(">l", d)[0] |
202 if l <= 4: | 202 if l <= 4: |
203 if l: | 203 if l: |
204 raise error.Abort(_("invalid chunk length %d") % l) | 204 raise error.Abort(_("invalid chunk length %d") % l) |
215 """v10 does not have a manifest header chunk""" | 215 """v10 does not have a manifest header chunk""" |
216 return {} | 216 return {} |
217 | 217 |
218 def filelogheader(self): | 218 def filelogheader(self): |
219 """return the header of the filelogs chunk, v10 only has the filename""" | 219 """return the header of the filelogs chunk, v10 only has the filename""" |
220 l = self.chunklength() | 220 l = self._chunklength() |
221 if not l: | 221 if not l: |
222 return {} | 222 return {} |
223 fname = readexactly(self._stream, l) | 223 fname = readexactly(self._stream, l) |
224 return {'filename': fname} | 224 return {'filename': fname} |
225 | 225 |
230 else: | 230 else: |
231 deltabase = prevnode | 231 deltabase = prevnode |
232 return node, p1, p2, deltabase, cs | 232 return node, p1, p2, deltabase, cs |
233 | 233 |
234 def deltachunk(self, prevnode): | 234 def deltachunk(self, prevnode): |
235 l = self.chunklength() | 235 l = self._chunklength() |
236 if not l: | 236 if not l: |
237 return {} | 237 return {} |
238 headerdata = readexactly(self._stream, self.deltaheadersize) | 238 headerdata = readexactly(self._stream, self.deltaheadersize) |
239 header = struct.unpack(self.deltaheader, headerdata) | 239 header = struct.unpack(self.deltaheader, headerdata) |
240 delta = readexactly(self._stream, l - self.deltaheadersize) | 240 delta = readexactly(self._stream, l - self.deltaheadersize) |