Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 27748:81b391a45264
context: clarify why we don't compare file contents when nodeid differs
See previous commit for timing information.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 12 Jan 2016 13:09:54 -0800 |
parents | 54522bbe1597 |
children | 215b47449e47 |
comparison
equal
deleted
inserted
replaced
27747:54522bbe1597 | 27748:81b391a45264 |
---|---|
138 (node1, flag1), (node2, flag2) = value | 138 (node1, flag1), (node2, flag2) = value |
139 if node1 is None: | 139 if node1 is None: |
140 added.append(fn) | 140 added.append(fn) |
141 elif node2 is None: | 141 elif node2 is None: |
142 removed.append(fn) | 142 removed.append(fn) |
143 elif node2 != _newnode: | 143 elif self.rev() is not None: |
144 # The file was not a new file in mf2, so an entry | 144 # When comparing files between two commits, we save time by |
145 # from diff is really a difference. | 145 # not comparing the file contents when the nodeids differ. |
146 # Note that this means we incorrectly report a reverted change | |
147 # to a file as a modification. | |
146 modified.append(fn) | 148 modified.append(fn) |
147 elif flag1 != flag2: | 149 elif flag1 != flag2: |
148 modified.append(fn) | 150 modified.append(fn) |
149 elif self[fn].cmp(other[fn]): | 151 elif self[fn].cmp(other[fn]): |
150 # node2 was newnode, but the working file doesn't | |
151 # match the one in mf1. | |
152 modified.append(fn) | 152 modified.append(fn) |
153 else: | 153 else: |
154 clean.append(fn) | 154 clean.append(fn) |
155 | 155 |
156 if removed: | 156 if removed: |