diff --git a/hgext3rd/fbsparse.py b/hgext3rd/fbsparse.py --- a/hgext3rd/fbsparse.py +++ b/hgext3rd/fbsparse.py @@ -78,8 +78,10 @@ """ actions, diverge, renamedelete = orig(repo, wctx, mctx, ancestors, branchmerge, *arg, **kwargs) - - if not util.safehasattr(repo, 'sparsematch'): + # If the working copy is in-memory (virtual), there's no need to apply + # the user's sparse rules at all (and in fact doing so would cause + # unexpected behavior in the real working copy). + if not util.safehasattr(repo, 'sparsematch') or wctx.isinmemory(): return actions, diverge, renamedelete files = set() diff --git a/hgext3rd/sparse.py b/hgext3rd/sparse.py --- a/hgext3rd/sparse.py +++ b/hgext3rd/sparse.py @@ -92,7 +92,7 @@ actions, diverge, renamedelete = orig(repo, wctx, mctx, ancestors, branchmerge, *arg, **kwargs) - if not util.safehasattr(repo, 'sparsematch'): + if not util.safehasattr(repo, 'sparsematch') or wctx.isinmemory(): return actions, diverge, renamedelete files = set()