mercurial/patch.py
changeset 16828 8abee656e14c
parent 16803 107a3270a24a
parent 16813 6d42c797ca6e
child 16834 cafd8a8fb713
--- 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)