Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 49892:c7624b1ac8b4
merge: cache the fs checks made during [_checkunknownfiles]
this ~halves the number of lstat calls made when updating
from rev(-1) to a revision with lots of files
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Wed, 04 Jan 2023 17:14:33 +0000 |
parents | 3aa8e569478a |
children | b7cf91ef03ba |
comparison
equal
deleted
inserted
replaced
49891:76d1e9f229fe | 49892:c7624b1ac8b4 |
---|---|
143 abortconflicts.update(conflicts) | 143 abortconflicts.update(conflicts) |
144 elif config == b'warn': | 144 elif config == b'warn': |
145 warnconflicts.update(conflicts) | 145 warnconflicts.update(conflicts) |
146 | 146 |
147 checkunknowndirs = _unknowndirschecker() | 147 checkunknowndirs = _unknowndirschecker() |
148 for f in mresult.files( | 148 with repo.wvfs.audit.cached(): |
149 ( | 149 for f in mresult.files( |
150 mergestatemod.ACTION_CREATED, | 150 ( |
151 mergestatemod.ACTION_DELETED_CHANGED, | 151 mergestatemod.ACTION_CREATED, |
152 ) | 152 mergestatemod.ACTION_DELETED_CHANGED, |
153 ): | 153 ) |
154 if _checkunknownfile(repo, wctx, mctx, f): | 154 ): |
155 fileconflicts.add(f) | 155 if _checkunknownfile(repo, wctx, mctx, f): |
156 elif pathconfig and f not in wctx: | 156 fileconflicts.add(f) |
157 path = checkunknowndirs(repo, wctx, f) | 157 elif pathconfig and f not in wctx: |
158 if path is not None: | 158 path = checkunknowndirs(repo, wctx, f) |
159 pathconflicts.add(path) | 159 if path is not None: |
160 pathconflicts.add(path) | |
160 for f, args, msg in mresult.getactions( | 161 for f, args, msg in mresult.getactions( |
161 [mergestatemod.ACTION_LOCAL_DIR_RENAME_GET] | 162 [mergestatemod.ACTION_LOCAL_DIR_RENAME_GET] |
162 ): | 163 ): |
163 if _checkunknownfile(repo, wctx, mctx, f, args[0]): | 164 if _checkunknownfile(repo, wctx, mctx, f, args[0]): |
164 fileconflicts.add(f) | 165 fileconflicts.add(f) |