changeset 2644:3fd4b0dca16c stable

effectflag: fix content change detection for filtered revs In some cases (like amended an obsolete changeset), computing the diff and comparing them need to work with filtered revisions. We need to use unfiltered change contexts to safely compute diffs.
author Boris Feld <boris.feld@octobus.net>
date Fri, 02 Jun 2017 19:07:35 +0200
parents 3c594000844b
children 850b504d6472
files README hgext3rd/evolve/obshistory.py
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/README
+++ b/README
@@ -121,6 +121,11 @@
 Changelog
 =========
 
+6.3.2 - in progress
+-------------------
+
+ - effect flag: fix a small bug related to hidden changeset,
+
 6.3.1 -- 2017-06-01
 -------------------
 
--- a/hgext3rd/evolve/obshistory.py
+++ b/hgext3rd/evolve/obshistory.py
@@ -494,8 +494,14 @@
 
     This is a first and basic implementation, with many shortcoming.
     """
-    leftdiff = leftctx.diff(git=1)
-    rightdiff = rightctx.diff(git=1)
+
+    # Leftctx or right ctx might be filtered, so we need to use the contexts
+    # with an unfiltered repository to safely compute the diff
+    leftunfi = leftctx._repo.unfiltered()[leftctx.rev()]
+    leftdiff = leftunfi.diff(git=1)
+    rightunfi = rightctx._repo.unfiltered()[rightctx.rev()]
+    rightdiff = rightunfi.diff(git=1)
+
     left, right = (0, 0)
     while None not in (left, right):
         left = _getdifflines(leftdiff)