# HG changeset patch # User Durham Goode # Date 2015-03-06 06:16:28 # Node ID e0c1328df87212fb0819a955919635aa80a58882 # Parent 4ef4e3c3c00693868ba428e21ac092e559e4fcea workingctx: use normal dirs() instead of dirstate.dirs() The workingctx class was using dirstate.dirs() as it's implementation. The sparse extension maintains a pruned down version of the dirstate, so this resulted in the workingctx reporting an incorrect listing of directories during merge calculations (it was detecting directory renames when it shouldn't have). The fix is to use the default implementation, which uses workingctx._manifest, which unions the manifest with the dirstate to produce the correct overall picture. This also produces more accurate output since it will no longer return directories that have been entirely deleted in the dirstate. Tests will be added to the sparse extension to detect regressions for this. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2071,6 +2071,7 @@ def remove(ui, repo, m, prefix, after, f % join(subpath)) # warn about failure to delete explicit files/dirs + deleteddirs = scmutil.dirs(deleted) for f in m.files(): def insubrepo(): for subpath in wctx.substate: @@ -2078,7 +2079,8 @@ def remove(ui, repo, m, prefix, after, f return True return False - if f in repo.dirstate or f in wctx.dirs() or f == '.' or insubrepo(): + isdir = f in deleteddirs or f in wctx.dirs() + if f in repo.dirstate or isdir or f == '.' or insubrepo(): continue if repo.wvfs.exists(f): diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1289,9 +1289,6 @@ class committablectx(basectx): self._repo.dirstate.setparents(node) self._repo.dirstate.endparentchange() - def dirs(self): - return self._repo.dirstate.dirs() - class workingctx(committablectx): """A workingctx object makes access to data related to the current working directory convenient.