From 48508ee29909fb6aae82c8e2d2619b5ab05c5f6a Mon Sep 17 00:00:00 2001 From: chrisjbillington Date: Fri, 6 Mar 2020 11:02:38 -0500 Subject: [PATCH] Fix failure to print error message in verify_heads On Python 3, `b'%s' % None` fails with a TypeError. In verify_heads, an error message prints the sha1 of a git commit, but that sha1 can be None. This commit instead prints `b''` if sha1 is None. --- hg-fast-export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hg-fast-export.py b/hg-fast-export.py index f92c861..93ec5bc 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -483,7 +483,7 @@ def verify_heads(ui,repo,cache,force,branchesmap): if sha1!=c: stderr_buffer.write( b'Error: Branch [%s] modified outside hg-fast-export:' - b'\n%s (repo) != %s (cache)\n' % (b, sha1, c) + b'\n%s (repo) != %s (cache)\n' % (b, b'' if sha1 is None else sha1, c) ) if not force: return False