context: back out sneaky code change in documentation change stable
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 25 Jan 2016 15:48:35 -0800
branchstable
changeset 27941 75fa75d31495
parent 27940 cfe7da66f555
child 27942 eb1135d5e688
context: back out sneaky code change in documentation change In 81b391a45264 (context: clarify why we don't compare file contents when nodeid differs, 2016-01-12), I also changed "node2 != _newnode" into "self.rev() is not None". I don't remember why. They are similar, but the former also catches the case where the file is clean in the dirstate (so node2 is not _newnode), but different from the "other" context. This resulted in unnecessary file content comparison a few lines further down in the code. Let's just back out the code change. Thanks to Durham Goode for spotting this.
mercurial/context.py
--- a/mercurial/context.py	Thu Jul 23 23:41:29 2015 +0900
+++ b/mercurial/context.py	Mon Jan 25 15:48:35 2016 -0800
@@ -142,7 +142,7 @@
                 removed.append(fn)
             elif flag1 != flag2:
                 modified.append(fn)
-            elif self.rev() is not None:
+            elif node2 != _newnode:
                 # 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