transaction: add clarifying comment about why ignoring some error is fine stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 15 Mar 2023 12:08:05 +0100
branchstable
changeset 50337 70ca1f09ceca
parent 50336 90276164333a
child 50338 cab3defe6d3b
transaction: add clarifying comment about why ignoring some error is fine It is less scary when explained.
mercurial/transaction.py
--- a/mercurial/transaction.py	Wed Mar 15 11:18:24 2023 +0100
+++ b/mercurial/transaction.py	Wed Mar 15 12:08:05 2023 +0100
@@ -150,6 +150,16 @@
                 try:
                     vfs.unlink(target)
                 except FileNotFoundError:
+                    # This is fine because
+                    #
+                    # either we are trying to delete the main file, and it is
+                    # already deleted.
+                    #
+                    # or we are trying to delete a temporary file and it is
+                    # already deleted.
+                    #
+                    # in both case, our target result (delete the file) is
+                    # already achieved.
                     pass
         except (IOError, OSError, error.Abort):
             if not c: