diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -740,6 +740,7 @@ def import_(ui, repo, patch1, *patches, hgpatch = False elif line == '# HG changeset patch': hgpatch = True + message = [] # We may have collected garbage else: message.append(line)