diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -370,7 +370,10 @@ if not self.iterator: return - if exc: + # Only gracefully abort in a normal exception situation. User aborts + # like Ctrl+C throw a KeyboardInterrupt which is not a base Exception, + # and should not gracefully cleanup. + if isinstance(exc, Exception): # If exiting or interrupted, do not attempt to seek the stream in # the finally block below. This makes abort faster. if (self.current and