diff -r 3e2aee6c5500 -r 470a83212dda mercurial/commands.py --- a/mercurial/commands.py Thu Jun 23 13:28:47 2005 -0800 +++ b/mercurial/commands.py Thu Jun 23 13:29:35 2005 -0800 @@ -397,8 +397,13 @@ if not quiet: print l if l[:14] == 'patching file ': - files.append(l[14:]) - f.close() + pf = l[14:] + if pf not in files: + files.append(pf) + patcherr = f.close() + if patcherr: + sys.stderr.write("patch failed") + sys.exit(1) if len(files) > 0: addremove(ui, repo, *files)