comparison hgext/largefiles/lfcommands.py @ 48168:df3021c1f093

largefiles: pass current transaction to `lfdirstate.write()` Right now, the largefile dirstate is not included in transaction which makes things complex. Next patch will add code to do so, so let's make it mandatory to pass current transaction and pass from all existing callers. Differential Revision: https://phab.mercurial-scm.org/D11610
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 19 Jul 2021 04:11:08 +0530
parents 5ced12cfa41b
children 6000f5b25c9b
comparison
equal deleted inserted replaced
48167:1b0f8aafedea 48168:df3021c1f093
567 ): 567 ):
568 wvfs.unlinkpath(lfile) 568 wvfs.unlinkpath(lfile)
569 removed += 1 569 removed += 1
570 570
571 # largefile processing might be slow and be interrupted - be prepared 571 # largefile processing might be slow and be interrupted - be prepared
572 lfdirstate.write() 572 lfdirstate.write(repo.currenttransaction())
573 573
574 if lfiles: 574 if lfiles:
575 lfiles = [f for f in lfiles if f not in dropped] 575 lfiles = [f for f in lfiles if f not in dropped]
576 576
577 for f in dropped: 577 for f in dropped:
617 617
618 updated += update1 618 updated += update1
619 619
620 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup) 620 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
621 621
622 lfdirstate.write() 622 lfdirstate.write(repo.currenttransaction())
623 if lfiles: 623 if lfiles:
624 statuswriter( 624 statuswriter(
625 _(b'%d largefiles updated, %d removed\n') % (updated, removed) 625 _(b'%d largefiles updated, %d removed\n') % (updated, removed)
626 ) 626 )
627 627