Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 24213:e0c1328df872
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 05 Mar 2015 22:16:28 -0800 |
parents | d8e0c591781c |
children | 4bb348ae43cb |
comparison
equal
deleted
inserted
replaced
24212:4ef4e3c3c006 | 24213:e0c1328df872 |
---|---|
2069 except error.LookupError: | 2069 except error.LookupError: |
2070 ui.status(_("skipping missing subrepository: %s\n") | 2070 ui.status(_("skipping missing subrepository: %s\n") |
2071 % join(subpath)) | 2071 % join(subpath)) |
2072 | 2072 |
2073 # warn about failure to delete explicit files/dirs | 2073 # warn about failure to delete explicit files/dirs |
2074 deleteddirs = scmutil.dirs(deleted) | |
2074 for f in m.files(): | 2075 for f in m.files(): |
2075 def insubrepo(): | 2076 def insubrepo(): |
2076 for subpath in wctx.substate: | 2077 for subpath in wctx.substate: |
2077 if f.startswith(subpath): | 2078 if f.startswith(subpath): |
2078 return True | 2079 return True |
2079 return False | 2080 return False |
2080 | 2081 |
2081 if f in repo.dirstate or f in wctx.dirs() or f == '.' or insubrepo(): | 2082 isdir = f in deleteddirs or f in wctx.dirs() |
2083 if f in repo.dirstate or isdir or f == '.' or insubrepo(): | |
2082 continue | 2084 continue |
2083 | 2085 |
2084 if repo.wvfs.exists(f): | 2086 if repo.wvfs.exists(f): |
2085 if repo.wvfs.isdir(f): | 2087 if repo.wvfs.isdir(f): |
2086 ui.warn(_('not removing %s: no tracked files\n') | 2088 ui.warn(_('not removing %s: no tracked files\n') |