changeset 50106:22cd517bc6b0

largefiles: rely on main scoping for writing dirstate in `markcommitted` Yeah, cleaner code.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 05 Feb 2023 12:09:52 +0100
parents 088ee6adfb09
children 9409f2946f16
files hgext/largefiles/lfutil.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Sun Feb 05 12:05:23 2023 +0100
+++ b/hgext/largefiles/lfutil.py	Sun Feb 05 12:09:52 2023 +0100
@@ -601,8 +601,7 @@
 def markcommitted(orig, ctx, node):
     repo = ctx.repo()
 
-    lfdirstate = openlfdirstate(repo.ui, repo)
-    with lfdirstate.changing_parents(repo):
+    with repo.dirstate.changing_parents(repo):
         orig(node)
 
         # ATTENTION: "ctx.files()" may differ from "repo[node].files()"
@@ -614,11 +613,11 @@
         # - have to be marked as "n" after commit, but
         # - aren't listed in "repo[node].files()"
 
+        lfdirstate = openlfdirstate(repo.ui, repo)
         for f in ctx.files():
             lfile = splitstandin(f)
             if lfile is not None:
                 synclfdirstate(repo, lfdirstate, lfile, False)
-    lfdirstate.write(repo.currenttransaction())
 
     # As part of committing, copy all of the largefiles into the cache.
     #