changeset 33127:0aae80d14fed

bundle2: add some debugging information to the not-a-bundle error I found this useful while trying to debug wireproto-related issues.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 27 Jun 2017 14:30:55 -0700
parents 98e2c78e309c
children 126eae7dae74
files mercurial/bundle2.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Wed Jun 28 12:23:22 2017 -0700
+++ b/mercurial/bundle2.py	Tue Jun 27 14:30:55 2017 -0700
@@ -678,6 +678,9 @@
         magicstring = changegroup.readexactly(fp, 4)
     magic, version = magicstring[0:2], magicstring[2:4]
     if magic != 'HG':
+        ui.debug(
+            "error: invalid magic: %r (version %r), should be 'HG'\n"
+            % (magic, version))
         raise error.Abort(_('not a Mercurial bundle'))
     unbundlerclass = formatmap.get(version)
     if unbundlerclass is None: