diff tests/test-extdiff.t @ 27183:0945539a3a6b

extdiff: correctly handle deleted subrepositories (issue3153) Previously, when extdiff was called on two changesets where a subrepository had been removed, an unexpected KeyError would be raised. Now, the missing subrepository will be ignored. This behavior mirrors the behavior in diffordiffstat from cmdutil.py line ~1138-1153. The KeyError is caught and the revision is set to None. try/catch of LookupError around matchmod.narrowmatcher and sub.status is removed, as LookupError is not raised anywhere within those methods or deeper calls.
author Andrew Zwicky <andrew.zwicky@gmail.com>
date Tue, 17 Nov 2015 16:42:52 -0600
parents 88c4e97b9669
children 34a2944aac9b
line wrap: on
line diff
--- a/tests/test-extdiff.t	Sat Nov 21 13:28:12 2015 +0900
+++ b/tests/test-extdiff.t	Tue Nov 17 16:42:52 2015 -0600
@@ -126,6 +126,25 @@
   diff-like tools yield a non-zero exit code
 #endif
 
+issue3153: ensure using extdiff with removed subrepos doesn't crash:
+
+  $ hg init suba
+  $ cd suba
+  $ echo suba > suba
+  $ hg add
+  adding suba
+  $ hg ci -m "adding suba file"
+  $ cd ..
+  $ echo suba=suba > .hgsub
+  $ hg add
+  adding .hgsub
+  $ hg ci -Sm "adding subrepo"
+  $ echo > .hgsub
+  $ hg ci -m "removing subrepo"
+  $ hg falabala -r 4 -r 5 -S
+  diffing a.398e36faf9c6 a.5ab95fb166c4
+  [1]
+
 issue4463: usage of command line configuration without additional quoting
 
   $ cat <<EOF >> $HGRCPATH