mercurial/bundle2.py
changeset 33127 0aae80d14fed
parent 33044 1d2b68952950
child 33128 126eae7dae74
equal deleted inserted replaced
33126:98e2c78e309c 33127:0aae80d14fed
   676     """return a valid unbundler object for a given magicstring"""
   676     """return a valid unbundler object for a given magicstring"""
   677     if magicstring is None:
   677     if magicstring is None:
   678         magicstring = changegroup.readexactly(fp, 4)
   678         magicstring = changegroup.readexactly(fp, 4)
   679     magic, version = magicstring[0:2], magicstring[2:4]
   679     magic, version = magicstring[0:2], magicstring[2:4]
   680     if magic != 'HG':
   680     if magic != 'HG':
       
   681         ui.debug(
       
   682             "error: invalid magic: %r (version %r), should be 'HG'\n"
       
   683             % (magic, version))
   681         raise error.Abort(_('not a Mercurial bundle'))
   684         raise error.Abort(_('not a Mercurial bundle'))
   682     unbundlerclass = formatmap.get(version)
   685     unbundlerclass = formatmap.get(version)
   683     if unbundlerclass is None:
   686     if unbundlerclass is None:
   684         raise error.Abort(_('unknown bundle version %s') % version)
   687         raise error.Abort(_('unknown bundle version %s') % version)
   685     unbundler = unbundlerclass(ui, fp)
   688     unbundler = unbundlerclass(ui, fp)