# HG changeset patch # User Durham Goode # Date 1425622588 28800 # 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 -r 4ef4e3c3c006 -r e0c1328df872 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Mar 05 15:52:07 2015 -0600 +++ b/mercurial/cmdutil.py Thu Mar 05 22:16:28 2015 -0800 @@ -2071,6 +2071,7 @@ % 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 @@ 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 -r 4ef4e3c3c006 -r e0c1328df872 mercurial/context.py --- a/mercurial/context.py Thu Mar 05 15:52:07 2015 -0600 +++ b/mercurial/context.py Thu Mar 05 22:16:28 2015 -0800 @@ -1289,9 +1289,6 @@ 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.