# HG changeset patch # User Martin Geisler # Date 1323962793 -3600 # Node ID 4841035f37b6df368682460d8a7cbf10276b8d1b # Parent c9913ef748f74419aaa25b0058e93e7c75dde3f8# Parent 82f5e471792d04a61ebb8d6e30faefe143954710 merge with stable diff -r c9913ef748f7 -r 4841035f37b6 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat Dec 10 18:40:05 2011 +0100 +++ b/mercurial/cmdutil.py Thu Dec 15 16:26:33 2011 +0100 @@ -588,8 +588,14 @@ ctx1 = repo[node1] ctx2 = repo[node2] for subpath, sub in subrepo.itersubrepos(ctx1, ctx2): - if node2 is not None: - node2 = ctx2.substate[subpath][1] + try: + if node2 is not None: + node2 = ctx2.substate[subpath][1] + except KeyError: + # A subrepo that existed in node1 was deleted between node1 and + # node2 (inclusive). Thus, ctx2's substate won't contain that + # subpath. The best we can do is to ignore it. + node2 = None submatch = matchmod.narrowmatcher(subpath, match) sub.diff(diffopts, node2, submatch, changes=changes, stat=stat, fp=fp, prefix=prefix) diff -r c9913ef748f7 -r 4841035f37b6 mercurial/commands.py --- a/mercurial/commands.py Sat Dec 10 18:40:05 2011 +0100 +++ b/mercurial/commands.py Thu Dec 15 16:26:33 2011 +0100 @@ -5155,7 +5155,8 @@ Examples: - - show changes in the working directory relative to a changeset: + - show changes in the working directory relative to a + changeset:: hg status --rev 9353 diff -r c9913ef748f7 -r 4841035f37b6 tests/test-subrepo.t --- a/tests/test-subrepo.t Sat Dec 10 18:40:05 2011 +0100 +++ b/tests/test-subrepo.t Thu Dec 15 16:26:33 2011 +0100 @@ -885,6 +885,22 @@ rm2 +Test issue3153: diff -S with deleted subrepos + + $ hg diff --nodates -S -c . + diff -r 3941e0aa5236 -r 8b31de9d13d1 .hgsub + --- a/.hgsub + +++ /dev/null + @@ -1,2 +0,0 @@ + -s = s + -t = t + diff -r 3941e0aa5236 -r 8b31de9d13d1 .hgsubstate + --- a/.hgsubstate + +++ /dev/null + @@ -1,2 +0,0 @@ + -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s + -e95bcfa18a358dc4936da981ebf4147b4cad1362 t + Test behavior of add for explicit path in subrepo: $ cd .. $ hg init explicit