# HG changeset patch # User Pierre-Yves David # Date 2023-02-05 11:09:52 # Node ID 22cd517bc6b023db56450a1302b403702d270512 # Parent 088ee6adfb09123ab7e1bbd559916cb13c6fec80 largefiles: rely on main scoping for writing dirstate in `markcommitted` Yeah, cleaner code. diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py +++ b/hgext/largefiles/lfutil.py @@ -601,8 +601,7 @@ def synclfdirstate(repo, lfdirstate, lfi 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 @@ def markcommitted(orig, ctx, node): # - 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. #