diff mercurial/copies.py @ 48477:79b904313357

pytype: stop excluding copies.py I can't prove that `targetrev` is always in `all_copies`, but it would have been a runtime error before too if it's not. Differential Revision: https://phab.mercurial-scm.org/D11916
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 13 Dec 2021 00:04:53 -0500
parents 19e6446cea11
children 6000f5b25c9b
line wrap: on
line diff
--- a/mercurial/copies.py	Sun Dec 12 22:29:46 2021 -0500
+++ b/mercurial/copies.py	Mon Dec 13 00:04:53 2021 -0500
@@ -448,7 +448,11 @@
 
         # filter out internal details and return a {dest: source mapping}
         final_copies = {}
-        for dest, (tt, source) in all_copies[targetrev].items():
+
+        targetrev_items = all_copies[targetrev]
+        assert targetrev_items is not None  # help pytype
+
+        for dest, (tt, source) in targetrev_items.items():
             if source is not None:
                 final_copies[dest] = source
     if not alwaysmatch: