# HG changeset patch # User Siddharth Agarwal # Date 2017-06-27 21:30:55 # Node ID 0aae80d14fed73b87a4070ce6a38b0f125bc498c # Parent 98e2c78e309cf750fa6dff6c8965fb24b979022c bundle2: add some debugging information to the not-a-bundle error I found this useful while trying to debug wireproto-related issues. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -678,6 +678,9 @@ def getunbundler(ui, fp, magicstring=Non 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: