diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py
--- a/mercurial/rewriteutil.py
+++ b/mercurial/rewriteutil.py
@@ -145,7 +145,7 @@
     for r in obsrevs:
         div = find_new_divergence_from(repo, repo[r])
         if div:
-            return (repo[r], repo[div[0]], repo[div[1]])
+            return (repo[r], repo[div[0]], repo.unfiltered()[div[1]])
     return None
 
 
diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -273,9 +273,9 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 Try to cause divergence
   $ hg amend -m C11
-  abort: filtered revision '26805aba1e600a82e93661149f2313866a221a7b' (known-bad-output !)
-  [255]
- [10]
+  abort: cannot amend 2758767f5d17, as that creates content-divergence with bfcb433a0dea, from 26805aba1e60
+  (add --verbose for details or see 'hg help evolution.instability')
+  [10]
 #endif
 
 Cannot amend public changeset