# HG changeset patch # User Martin von Zweigbergk # Date 2016-01-12 21:09:54 # Node ID 81b391a45264096b14cfbfb291497cdde57c3646 # Parent 54522bbe15971ec3b063b2897e452af5faa06249 context: clarify why we don't compare file contents when nodeid differs See previous commit for timing information. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -140,15 +140,15 @@ class basectx(object): added.append(fn) elif node2 is None: removed.append(fn) - elif node2 != _newnode: - # The file was not a new file in mf2, so an entry - # from diff is really a difference. + 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]): - # node2 was newnode, but the working file doesn't - # match the one in mf1. modified.append(fn) else: clean.append(fn)