Mercurial > hg
comparison hgext/largefiles/overrides.py @ 47649:4b17971f0181
largefile: use parentchange during mergerecordupdates
This match what core is doing around recordupdates.
Differential Revision: https://phab.mercurial-scm.org/D11105
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 08 Jul 2021 01:24:11 +0200 |
parents | 093b1df410c9 |
children | 1e5a9783bba8 |
comparison
equal
deleted
inserted
replaced
47648:093b1df410c9 | 47649:4b17971f0181 |
---|---|
648 | 648 |
649 @eh.wrapfunction(mergestatemod, b'recordupdates') | 649 @eh.wrapfunction(mergestatemod, b'recordupdates') |
650 def mergerecordupdates(orig, repo, actions, branchmerge, getfiledata): | 650 def mergerecordupdates(orig, repo, actions, branchmerge, getfiledata): |
651 if MERGE_ACTION_LARGEFILE_MARK_REMOVED in actions: | 651 if MERGE_ACTION_LARGEFILE_MARK_REMOVED in actions: |
652 lfdirstate = lfutil.openlfdirstate(repo.ui, repo) | 652 lfdirstate = lfutil.openlfdirstate(repo.ui, repo) |
653 for lfile, args, msg in actions[MERGE_ACTION_LARGEFILE_MARK_REMOVED]: | 653 with lfdirstate.parentchange(): |
654 # this should be executed before 'orig', to execute 'remove' | 654 for lfile, args, msg in actions[ |
655 # before all other actions | 655 MERGE_ACTION_LARGEFILE_MARK_REMOVED |
656 repo.dirstate.remove(lfile) | 656 ]: |
657 # make sure lfile doesn't get synclfdirstate'd as normal | 657 # this should be executed before 'orig', to execute 'remove' |
658 lfdirstate.add(lfile) | 658 # before all other actions |
659 repo.dirstate.remove(lfile) | |
660 # make sure lfile doesn't get synclfdirstate'd as normal | |
661 lfdirstate.add(lfile) | |
659 lfdirstate.write() | 662 lfdirstate.write() |
660 | 663 |
661 return orig(repo, actions, branchmerge, getfiledata) | 664 return orig(repo, actions, branchmerge, getfiledata) |
662 | 665 |
663 | 666 |