# HG changeset patch # User Manuel Jacob # Date 2022-05-31 23:30:48 # Node ID fce59125608538fda8e669224f1b843c081a05f2 # Parent defc369d705e6824de3908082f52e571baf5f636 commit: remove special handling of IOError (actually dead code) In the past, IOError was used to mark a file as removed. The differentiation between OSError and IOError in this place was introduced in e553a425751d, to avoid that “normal” OSErrors / IOErrors accidentally mark files as removed. This weird internal API was removed in 650b5b6e75ed. It seems like that changeset should have removed the differentiation, at least I don’t see any reason for keeping it. On Python 3, OSError and IOError are aliased. Therefore the removed code was actually dead. diff --git a/mercurial/commit.py b/mercurial/commit.py --- a/mercurial/commit.py +++ b/mercurial/commit.py @@ -4,8 +4,6 @@ # GNU General Public License version 2 or any later version. -import errno - from .i18n import _ from .node import ( hex, @@ -250,11 +248,6 @@ def _process_files(tr, ctx, ms, files, n except OSError: repo.ui.warn(_(b"trouble committing %s!\n") % uipathfn(f)) raise - except IOError as inst: - errcode = getattr(inst, 'errno', errno.ENOENT) - if error or errcode and errcode != errno.ENOENT: - repo.ui.warn(_(b"trouble committing %s!\n") % uipathfn(f)) - raise # update manifest removed = [f for f in removed if f in m1 or f in m2]