comparison hgext/largefiles/overrides.py @ 47702:0149d17da91b

largefile: adjust the dirstate post update within a `parentchange` context This is doing an update, so this seems more appropriate. No other change have been made, but the next changeset will :-) Differential Revision: https://phab.mercurial-scm.org/D11144
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Jul 2021 00:05:47 +0200
parents 9fa1085fbd63
children 7d2f0e14da4c
comparison
equal deleted inserted replaced
47701:0e87c90f1cd5 47702:0149d17da91b
1794 # largefiles is not a good candidate for in-memory merge (large 1794 # largefiles is not a good candidate for in-memory merge (large
1795 # files, custom dirstate, matcher usage). 1795 # files, custom dirstate, matcher usage).
1796 raise error.ProgrammingError( 1796 raise error.ProgrammingError(
1797 b'largefiles is not compatible with in-memory merge' 1797 b'largefiles is not compatible with in-memory merge'
1798 ) 1798 )
1799 result = orig(repo, node, branchmerge, force, *args, **kwargs) 1799 with lfdirstate.parentchange():
1800 1800 result = orig(repo, node, branchmerge, force, *args, **kwargs)
1801 newstandins = lfutil.getstandinsstate(repo) 1801
1802 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) 1802 newstandins = lfutil.getstandinsstate(repo)
1803 1803 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1804 # to avoid leaving all largefiles as dirty and thus rehash them, mark 1804
1805 # all the ones that didn't change as clean 1805 # to avoid leaving all largefiles as dirty and thus rehash them, mark
1806 for lfile in oldclean.difference(filelist): 1806 # all the ones that didn't change as clean
1807 lfdirstate.normal(lfile) 1807 for lfile in oldclean.difference(filelist):
1808 lfdirstate.write() 1808 lfdirstate.normal(lfile)
1809 1809 lfdirstate.write()
1810 if branchmerge or force or partial: 1810
1811 filelist.extend(s.deleted + s.removed) 1811 if branchmerge or force or partial:
1812 1812 filelist.extend(s.deleted + s.removed)
1813 lfcommands.updatelfiles( 1813
1814 repo.ui, repo, filelist=filelist, normallookup=partial 1814 lfcommands.updatelfiles(
1815 ) 1815 repo.ui, repo, filelist=filelist, normallookup=partial
1816 )
1816 1817
1817 return result 1818 return result
1818 1819
1819 1820
1820 @eh.wrapfunction(scmutil, b'marktouched') 1821 @eh.wrapfunction(scmutil, b'marktouched')