# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2021-07-13 09:24:09 # Node ID f0cf560475a354be6d913d5144af4b31a2fc8b69 # Parent 1bad89a677454067dd5781a48351a702c33aad6c largefiles: replace use of synclfdirstate with drop Replace calling a complex function with a simple dedicated one Differential Revision: https://phab.mercurial-scm.org/D11113 diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -565,20 +565,19 @@ def updatelfiles( # largefile processing might be slow and be interrupted - be prepared lfdirstate.write() - with lfdirstate.parentchange(): - if lfiles: - lfiles = [f for f in lfiles if f not in dropped] - - for f in dropped: - repo.wvfs.unlinkpath(lfutil.standin(f)) + if lfiles: + lfiles = [f for f in lfiles if f not in dropped] - # This needs to happen for dropped files, otherwise they stay in - # the M state. - lfutil.synclfdirstate(repo, lfdirstate, f, normallookup) + for f in dropped: + repo.wvfs.unlinkpath(lfutil.standin(f)) + # This needs to happen for dropped files, otherwise they stay in + # the M state. + lfdirstate._drop(f) - statuswriter(_(b'getting changed largefiles\n')) - cachelfiles(ui, repo, None, lfiles) + statuswriter(_(b'getting changed largefiles\n')) + cachelfiles(ui, repo, None, lfiles) + with lfdirstate.parentchange(): for lfile in lfiles: update1 = 0