mercurial/patch.py
branchstable
changeset 16813 6d42c797ca6e
parent 16650 fcb97d9a26cd
child 16828 8abee656e14c
--- a/mercurial/patch.py	Tue May 29 18:27:12 2012 +0300
+++ b/mercurial/patch.py	Fri Jun 01 17:37:56 2012 +0200
@@ -1343,8 +1343,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)