2305 |
2306 |
2306 # Check subrepos. This depends on in-place wctx._status update in |
2307 # Check subrepos. This depends on in-place wctx._status update in |
2307 # subrepo.precommit(). To minimize the risk of this hack, we do |
2308 # subrepo.precommit(). To minimize the risk of this hack, we do |
2308 # nothing if .hgsub does not exist. |
2309 # nothing if .hgsub does not exist. |
2309 if '.hgsub' in wctx or '.hgsub' in old: |
2310 if '.hgsub' in wctx or '.hgsub' in old: |
2310 from . import subrepo # avoid cycle: cmdutil -> subrepo -> cmdutil |
2311 subs, commitsubs, newsubstate = subrepoutil.precommit( |
2311 subs, commitsubs, newsubstate = subrepo.precommit( |
|
2312 ui, wctx, wctx._status, matcher) |
2312 ui, wctx, wctx._status, matcher) |
2313 # amend should abort if commitsubrepos is enabled |
2313 # amend should abort if commitsubrepos is enabled |
2314 assert not commitsubs |
2314 assert not commitsubs |
2315 if subs: |
2315 if subs: |
2316 subrepo.writestate(repo, newsubstate) |
2316 subrepoutil.writestate(repo, newsubstate) |
2317 |
2317 |
2318 filestoamend = set(f for f in wctx.files() if matcher(f)) |
2318 filestoamend = set(f for f in wctx.files() if matcher(f)) |
2319 |
2319 |
2320 changes = (len(filestoamend) > 0) |
2320 changes = (len(filestoamend) > 0) |
2321 if changes: |
2321 if changes: |