diff mercurial/patch.py @ 16828:8abee656e14c

merge with stable
author Matt Mackall <mpm@selenic.com>
date Fri, 01 Jun 2012 15:14:29 -0500
parents 107a3270a24a 6d42c797ca6e
children cafd8a8fb713
line wrap: on
line diff
--- a/mercurial/patch.py	Fri Jun 01 15:13:05 2012 -0500
+++ b/mercurial/patch.py	Fri Jun 01 15:14:29 2012 -0500
@@ -1345,8 +1345,17 @@
         elif state == 'git':
             for gp in values:
                 path = pstrip(gp.oldpath)
-                data, mode = backend.getfile(path)
-                store.setfile(path, data, mode)
+                try:
+                    data, mode = backend.getfile(path)
+                except IOError, e:
+                    if e.errno != errno.ENOENT:
+                        raise
+                    # The error ignored here will trigger a getfile()
+                    # error in a place more appropriate for error
+                    # handling, and will not interrupt the patching
+                    # process.
+                else:
+                    store.setfile(path, data, mode)
         else:
             raise util.Abort(_('unsupported parser state: %s') % state)