diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -140,14 +140,14 @@ class basectx(object): 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: diff --git a/tests/test-status.t b/tests/test-status.t --- a/tests/test-status.t +++ b/tests/test-status.t @@ -388,6 +388,17 @@ reverted file with changed flag should a $ hg revert -r 0 . reverting file + +reverted and committed file with changed flag should appear modified + + $ hg co -C . + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ chmod +x file + $ hg ci -m 'change flag' + $ hg status -A --rev 1 --rev 2 + M file + $ hg diff -r 1 -r 2 + #endif hg status of binary file starting with '\1\n', a separator for metadata: