Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
27748:81b391a45264 | 27749:215b47449e47 |
---|---|
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 flag1 != flag2: | |
144 modified.append(fn) | |
143 elif self.rev() is not None: | 145 elif self.rev() is not None: |
144 # When comparing files between two commits, we save time by | 146 # When comparing files between two commits, we save time by |
145 # not comparing the file contents when the nodeids differ. | 147 # not comparing the file contents when the nodeids differ. |
146 # Note that this means we incorrectly report a reverted change | 148 # Note that this means we incorrectly report a reverted change |
147 # to a file as a modification. | 149 # to a file as a modification. |
148 modified.append(fn) | |
149 elif flag1 != flag2: | |
150 modified.append(fn) | 150 modified.append(fn) |
151 elif self[fn].cmp(other[fn]): | 151 elif self[fn].cmp(other[fn]): |
152 modified.append(fn) | 152 modified.append(fn) |
153 else: | 153 else: |
154 clean.append(fn) | 154 clean.append(fn) |