# HG changeset patch # User Pierre-Yves David # Date 1675595392 -3600 # Node ID 22cd517bc6b023db56450a1302b403702d270512 # Parent 088ee6adfb09123ab7e1bbd559916cb13c6fec80 largefiles: rely on main scoping for writing dirstate in `markcommitted` Yeah, cleaner code. diff -r 088ee6adfb09 -r 22cd517bc6b0 hgext/largefiles/lfutil.py --- 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. #