# HG changeset patch # User mpm@selenic.com # Date 1119562175 28800 # Node ID 470a83212ddad6648ec9a40a2c89f4a1bb379bc0 # Parent 3e2aee6c5500a50fa3cb1619ce1e65569ff23c5c hg import error checking -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg import error checking From: Chris Mason hg import wasn't checking the return value of patch and wasn't making sure the list of files collected was unique. manifest hash: 85b2a0f0602cfff6ba6a61128a50d79d7fb6e1c7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuym/ywK+sNU5EO8RAlwSAJ48h8hHi3JMNwrVq0CXIfgMCTGRRQCfSfpP 9kHam+Rt8tra46lCQ4d27G4= =P00x -----END PGP SIGNATURE----- diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -397,8 +397,13 @@ def import_(ui, repo, patch1, *patches, 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)