comparison hgext/largefiles/overrides.py @ 47652:12300ee6840b

largefile: use `parentchange` during rollback rollback is updating parent without touching the working copy. It should wrapped in a `parentchange` context. Differential Revision: https://phab.mercurial-scm.org/D11108
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Jul 2021 01:47:41 +0200
parents 1e5a9783bba8
children 00d70f61d856
comparison
equal deleted inserted replaced
47651:40811cc7fa56 47652:12300ee6840b
1634 lfutil.writestandin(repo, f, b'', False) 1634 lfutil.writestandin(repo, f, b'', False)
1635 for standin in orphans: 1635 for standin in orphans:
1636 repo.wvfs.unlinkpath(standin, ignoremissing=True) 1636 repo.wvfs.unlinkpath(standin, ignoremissing=True)
1637 1637
1638 lfdirstate = lfutil.openlfdirstate(ui, repo) 1638 lfdirstate = lfutil.openlfdirstate(ui, repo)
1639 orphans = set(lfdirstate) 1639 with lfdirstate.parentchange():
1640 lfiles = lfutil.listlfiles(repo) 1640 orphans = set(lfdirstate)
1641 for file in lfiles: 1641 lfiles = lfutil.listlfiles(repo)
1642 lfutil.synclfdirstate(repo, lfdirstate, file, True) 1642 for file in lfiles:
1643 orphans.discard(file) 1643 lfutil.synclfdirstate(repo, lfdirstate, file, True)
1644 for lfile in orphans: 1644 orphans.discard(file)
1645 lfdirstate.drop(lfile) 1645 for lfile in orphans:
1646 lfdirstate.drop(lfile)
1646 lfdirstate.write() 1647 lfdirstate.write()
1647 return result 1648 return result
1648 1649
1649 1650
1650 @eh.wrapcommand(b'transplant', extension=b'transplant') 1651 @eh.wrapcommand(b'transplant', extension=b'transplant')