# HG changeset patch # User Martin von Zweigbergk # Date 2016-01-12 21:10:31 # Node ID 215b47449e473738ecb8dbb41a41959803a40c1d # Parent 81b391a45264096b14cfbfb291497cdde57c3646 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. 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: