[PATCH 1 of 3] status: back out changeset 89f49813526c

Martin von Zweigbergk martinvonz at google.com
Tue Jan 12 21:43:46 UTC 2016


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1452631416 28800
#      Tue Jan 12 12:43:36 2016 -0800
# Node ID f07b94c8bb3a311a47e91a2bc528f7d91145fc13
# Parent  edd2615ad226c14f6904fc1738c3dc36431db223
status: back out changeset 89f49813526c

This backs out 89f49813526c (status: change + back out == clean (API),
2016-01-04). Although correct, it turned out that it was just too
slow. For example, 'hg status --rev .~1000 --rev .' on the Mozilla
repo went from <1s to >30s on cold disk. So we go back to reporting
reverted changes as modified instead of clean. These are rare anyway,
as suggested by the fact that it had been broken since before
Mercurial 2.0.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -140,9 +140,15 @@
                 added.append(fn)
             elif node2 is None:
                 removed.append(fn)
+            elif node2 != _newnode:
+                # The file was not a new file in mf2, so an entry
+                # from diff is really a difference.
+                modified.append(fn)
             elif flag1 != flag2:
                 modified.append(fn)
             elif self[fn].cmp(other[fn]):
+                # node2 was newnode, but the working file doesn't
+                # match the one in mf1.
                 modified.append(fn)
             else:
                 clean.append(fn)
diff --git a/tests/test-status.t b/tests/test-status.t
--- a/tests/test-status.t
+++ b/tests/test-status.t
@@ -388,14 +388,6 @@
 
 #endif
 
-reverted and commit change should appear clean
-
-  $ hg revert -r 0 .
-  reverting file
-  $ hg ci -m a
-  $ hg status -A --rev 0 --rev 2
-  C file
-
   $ cd ..
 
 hg status of binary file starting with '\1\n', a separator for metadata:


More information about the Mercurial-devel mailing list