Mercurial > public > mercurial-scm > hg-stable
diff mercurial/merge.py @ 43677:0b7733719d21
utils: move finddirs() to pathutil
This is a follow-up to c21aca51b392 (utils: move the `dirs` definition
in pathutil (API), 2019-11-06). finddirs() is closely related to dirs
and used by it.
Differential Revision: https://phab.mercurial-scm.org/D7388
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 14 Nov 2019 08:03:26 -0800 |
parents | be384a2052aa |
children | 95d2eab0a7b9 |
line wrap: on
line diff
--- a/mercurial/merge.py Wed Nov 13 21:52:25 2019 -0500 +++ b/mercurial/merge.py Thu Nov 14 08:03:26 2019 -0800 @@ -32,6 +32,7 @@ filemerge, match as matchmod, obsutil, + pathutil, pycompat, scmutil, subrepoutil, @@ -813,7 +814,7 @@ return False # Check for path prefixes that exist as unknown files. - for p in reversed(list(util.finddirs(f))): + for p in reversed(list(pathutil.finddirs(f))): if p in self._missingdircache: return if p in self._unknowndircache: @@ -947,7 +948,7 @@ backup = ( f in fileconflicts or f in pathconflicts - or any(p in pathconflicts for p in util.finddirs(f)) + or any(p in pathconflicts for p in pathutil.finddirs(f)) ) (flags,) = args actions[f] = (ACTION_GET, (flags, backup), msg) @@ -1077,7 +1078,7 @@ in. """ for f in manifest: - for p in util.finddirs(f): + for p in pathutil.finddirs(f): if p in dirs: yield f, p break @@ -1116,7 +1117,7 @@ ACTION_CREATED_MERGE, ): # This action may create a new local file. - createdfiledirs.update(util.finddirs(f)) + createdfiledirs.update(pathutil.finddirs(f)) if mf.hasdir(f): # The file aliases a local directory. This might be ok if all # the files in the local directory are being deleted. This @@ -1710,7 +1711,7 @@ # with a directory this file is in, and if so, back that up. conflicting = f if not repo.wvfs.lexists(f): - for p in util.finddirs(f): + for p in pathutil.finddirs(f): if repo.wvfs.isfileorlink(p): conflicting = p break