Patchwork [STABLE] context: back out sneaky code change in documentation change

mail settings
Submitter Martin von Zweigbergk
Date Jan. 26, 2016, 12:02 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/12888/
State Superseded
Headers show


Martin von Zweigbergk - Jan. 26, 2016, 12:02 a.m.
# HG changeset patch
# User Martin von Zweigbergk <>
# Date 1453765715 28800
#      Mon Jan 25 15:48:35 2016 -0800
# Branch stable
# Node ID 14c76a66188ab9b58223dbbe95950029bdd893af
# Parent  cfe7da66f5550c539a4b8bf46772e1366687f60c
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.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -142,7 +142,7 @@ 
             elif flag1 != flag2:
-            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