diff mercurial/context.py @ 27749:215b47449e47

context: check for differing flags a little earlier This makes it clearer that a unchanged file whose flags have changed will be reported as a modification. Also test this.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 12 Jan 2016 13:10:31 -0800
parents 81b391a45264
children 37a75d69eb43
line wrap: on
line diff
--- a/mercurial/context.py	Tue Jan 12 13:09:54 2016 -0800
+++ b/mercurial/context.py	Tue Jan 12 13:10:31 2016 -0800
@@ -140,14 +140,14 @@
                 added.append(fn)
             elif node2 is None:
                 removed.append(fn)
+            elif flag1 != flag2:
+                modified.append(fn)
             elif self.rev() is not None:
                 # When comparing files between two commits, we save time by
                 # not comparing the file contents when the nodeids differ.
                 # Note that this means we incorrectly report a reverted change
                 # to a file as a modification.
                 modified.append(fn)
-            elif flag1 != flag2:
-                modified.append(fn)
             elif self[fn].cmp(other[fn]):
                 modified.append(fn)
             else: