changeset 443:470a83212dda

hg import error checking -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg import error checking From: Chris Mason <mason@suse.com> 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-----
author mpm@selenic.com
date Thu, 23 Jun 2005 13:29:35 -0800
parents 3e2aee6c5500
children 2cdcb4beecb2
files mercurial/commands.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)