Show More
@@ -399,15 +399,17 b' class unbundle20(unpackermixin):' | |||||
399 |
|
399 | |||
400 | (this will eventually yield parts)""" |
|
400 | (this will eventually yield parts)""" | |
401 |
|
401 | |||
402 | def __init__(self, ui, fp): |
|
402 | def __init__(self, ui, fp, header=None): | |
|
403 | """If header is specified, we do not read it out of the stream.""" | |||
403 | self.ui = ui |
|
404 | self.ui = ui | |
404 | super(unbundle20, self).__init__(fp) |
|
405 | super(unbundle20, self).__init__(fp) | |
405 | header = self._readexact(4) |
|
406 | if header is None: | |
406 | magic, version = header[0:2], header[2:4] |
|
407 | header = self._readexact(4) | |
407 | if magic != 'HG': |
|
408 | magic, version = header[0:2], header[2:4] | |
408 | raise util.Abort(_('not a Mercurial bundle')) |
|
409 | if magic != 'HG': | |
409 | if version != '20': |
|
410 | raise util.Abort(_('not a Mercurial bundle')) | |
410 | raise util.Abort(_('unknown bundle version %s') % version) |
|
411 | if version != '20': | |
|
412 | raise util.Abort(_('unknown bundle version %s') % version) | |||
411 | self.ui.debug('start processing of %s stream\n' % header) |
|
413 | self.ui.debug('start processing of %s stream\n' % header) | |
412 |
|
414 | |||
413 | @util.propertycache |
|
415 | @util.propertycache |
General Comments 0
You need to be logged in to leave comments.
Login now