large-files: make sure we write newly initialized standin file early
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 21 Feb 2023 03:22:51 +0100
changeset 50116 9b49809eb612
parent 50115 62f633f751a4
child 50117 3433723d1b9b
large-files: make sure we write newly initialized standin file early Any changing context will have to initialized it before anything else. Not flushing the default (pre-change) content mean we would enter the changing context with a dirty dirstate, which is odd.
hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py	Mon Feb 20 14:06:15 2023 +0100
+++ b/hgext/largefiles/lfutil.py	Tue Feb 21 03:22:51 2023 +0100
@@ -249,6 +249,8 @@
                         wc_tracked=True,
                         possibly_dirty=True,
                     )
+                # avoid getting dirty dirstate before other operations
+                lfdirstate.write(repo.currenttransaction())
         except error.LockError:
             # Assume that whatever was holding the lock was important.
             # If we were doing something important, we would already have