Patchwork D11113: largefiles: replace use of synclfdirstate with drop

login
register
mail settings
Submitter phabricator
Date July 18, 2021, 9:53 p.m.
Message ID <differential-rev-PHID-DREV-tkqaf376d633fqwanxlv-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49426/
State Superseded
Headers show

Comments

phabricator - July 18, 2021, 9:53 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Replace calling a complex function with a simple dedicated one

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11113

AFFECTED FILES
  hgext/largefiles/lfcommands.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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 @@ 
         # 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