44 msg %= (section, name, config, validstr) |
44 msg %= (section, name, config, validstr) |
45 raise error.ConfigError(msg) |
45 raise error.ConfigError(msg) |
46 return config |
46 return config |
47 |
47 |
48 |
48 |
49 def _checkunknownfile(repo, wctx, mctx, f, f2=None): |
49 def _checkunknownfile(repo, dircache, wctx, mctx, f, f2=None): |
50 if wctx.isinmemory(): |
50 if wctx.isinmemory(): |
51 # Nothing to do in IMM because nothing in the "working copy" can be an |
51 # Nothing to do in IMM because nothing in the "working copy" can be an |
52 # unknown file. |
52 # unknown file. |
53 # |
53 # |
54 # Note that we should bail out here, not in ``_checkunknownfiles()``, |
54 # Note that we should bail out here, not in ``_checkunknownfiles()``, |
134 unknownconfig = _getcheckunknownconfig(repo, b'merge', b'checkunknown') |
133 unknownconfig = _getcheckunknownconfig(repo, b'merge', b'checkunknown') |
135 ignoredconfig = _getcheckunknownconfig(repo, b'merge', b'checkignored') |
134 ignoredconfig = _getcheckunknownconfig(repo, b'merge', b'checkignored') |
136 pathconfig = repo.ui.configbool( |
135 pathconfig = repo.ui.configbool( |
137 b'experimental', b'merge.checkpathconflicts' |
136 b'experimental', b'merge.checkpathconflicts' |
138 ) |
137 ) |
|
138 dircache = dict() |
139 if not force: |
139 if not force: |
140 |
140 |
141 def collectconflicts(conflicts, config): |
141 def collectconflicts(conflicts, config): |
142 if config == b'abort': |
142 if config == b'abort': |
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 with repo.wvfs.audit.cached(): |
148 for f in mresult.files( |
149 for f in mresult.files( |
149 ( |
150 ( |
150 mergestatemod.ACTION_CREATED, |
151 mergestatemod.ACTION_CREATED, |
151 mergestatemod.ACTION_DELETED_CHANGED, |
152 mergestatemod.ACTION_DELETED_CHANGED, |
152 ) |
153 ) |
153 ): |
154 ): |
154 if _checkunknownfile(repo, dircache, wctx, mctx, f): |
155 if _checkunknownfile(repo, wctx, mctx, f): |
155 fileconflicts.add(f) |
156 fileconflicts.add(f) |
156 elif pathconfig and f not in wctx: |
157 elif pathconfig and f not in wctx: |
157 path = checkunknowndirs(repo, wctx, f) |
158 path = checkunknowndirs(repo, wctx, f) |
158 if path is not None: |
159 if path is not None: |
159 pathconflicts.add(path) |
160 pathconflicts.add(path) |
|
161 for f, args, msg in mresult.getactions( |
160 for f, args, msg in mresult.getactions( |
162 [mergestatemod.ACTION_LOCAL_DIR_RENAME_GET] |
161 [mergestatemod.ACTION_LOCAL_DIR_RENAME_GET] |
163 ): |
162 ): |
164 if _checkunknownfile(repo, wctx, mctx, f, args[0]): |
163 if _checkunknownfile(repo, wctx, mctx, f, args[0]): |
165 fileconflicts.add(f) |
164 fileconflicts.add(f) |