comparison mercurial/context.py @ 27720:89f49813526c

status: change + back out == clean (API) After backing out a change, so the file contents is equal to a previous revision of itself, we currently report the status between the two equal revisions as modified. This is because context._buildstatus() reports any file whose new nodeid is not equal to _newnode as modified. That magic nodeid is given only to files added or modified in the working directory, so any file whose nodeid has changed between two revisions will be reported as modified. Fix by simply comparing the file contents for all cases where the nodeid changed, whether they are in the working copy or committed. Marking with (API) as it subtly changes the semantics of the method.
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 04 Jan 2016 10:13:29 -0800
parents 369c8f9453c2
children 54522bbe1597
comparison
equal deleted inserted replaced
27719:7ce8a13b8d77 27720:89f49813526c
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:
144 # The file was not a new file in mf2, so an entry
145 # from diff is really a difference.
146 modified.append(fn)
147 elif flag1 != flag2: 143 elif flag1 != flag2:
148 modified.append(fn) 144 modified.append(fn)
149 elif self[fn].cmp(other[fn]): 145 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) 146 modified.append(fn)
153 else: 147 else:
154 clean.append(fn) 148 clean.append(fn)
155 149
156 if removed: 150 if removed: