Mercurial > public > mercurial-scm > hg
comparison mercurial/sparse.py @ 47708:7bdfd88251c0
sparse: apply update with in a `parentchange` context
We are changing the reference so we should be within such context manager.
This seems make the actual dirstate content a bit flaky with content being
sometime ambigous (but maybe it was flaky before?)
So I increased the matching.
Differential Revision: https://phab.mercurial-scm.org/D11150
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 19 Jul 2021 04:26:06 +0200 |
parents | 26bf0b9fe78f |
children | a0e79084389d |
comparison
equal
deleted
inserted
replaced
47707:61753b1ba96f | 47708:7bdfd88251c0 |
---|---|
437 mergestatemod.ACTION_GET, | 437 mergestatemod.ACTION_GET, |
438 (fctx.flags(), False), | 438 (fctx.flags(), False), |
439 message, | 439 message, |
440 ) | 440 ) |
441 | 441 |
442 mergemod.applyupdates( | 442 with repo.dirstate.parentchange(): |
443 repo, tmresult, repo[None], repo[b'.'], False, wantfiledata=False | 443 mergemod.applyupdates( |
444 ) | 444 repo, |
445 | 445 tmresult, |
446 dirstate = repo.dirstate | 446 repo[None], |
447 for file, flags, msg in tmresult.getactions([mergestatemod.ACTION_GET]): | 447 repo[b'.'], |
448 dirstate.normal(file) | 448 False, |
449 wantfiledata=False, | |
450 ) | |
451 | |
452 dirstate = repo.dirstate | |
453 for file, flags, msg in tmresult.getactions( | |
454 [mergestatemod.ACTION_GET] | |
455 ): | |
456 dirstate.normal(file) | |
449 | 457 |
450 profiles = activeconfig(repo)[2] | 458 profiles = activeconfig(repo)[2] |
451 changedprofiles = profiles & files | 459 changedprofiles = profiles & files |
452 # If an active profile changed during the update, refresh the checkout. | 460 # If an active profile changed during the update, refresh the checkout. |
453 # Don't do this during a branch merge, since all incoming changes should | 461 # Don't do this during a branch merge, since all incoming changes should |