Patchwork D12123: dirstate: rename the filegenerator used for writing

login
register
mail settings
Submitter phabricator
Date Jan. 31, 2022, 3:30 p.m.
Message ID <differential-rev-PHID-DREV-d7wtyyvjq2dedw2urnph-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50449/
State New
Headers show

Comments

phabricator - Jan. 31, 2022, 3:30 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We will need a different name in the next changesets. Changing the name is
  actually not that trivial so we do it in its own changeset.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py
  mercurial/transaction.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -28,7 +28,10 @@ 
 # These are the file generators that should only be executed after the
 # finalizers are done, since they rely on the output of the finalizers (like
 # the changelog having been written).
-postfinalizegenerators = {b'bookmarks', b'dirstate'}
+postfinalizegenerators = {
+    b'bookmarks',
+    b'dirstate-1-main',
+}
 
 GEN_GROUP_ALL = b'all'
 GEN_GROUP_PRE_FINALIZE = b'prefinalize'
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -706,7 +706,7 @@ 
         if tr:
             # delay writing in-memory changes out
             tr.addfilegenerator(
-                b'dirstate',
+                b'dirstate-1-main',
                 (self._filename,),
                 lambda f: self._writedirstate(tr, f),
                 location=b'plain',
@@ -1374,7 +1374,7 @@ 
             # changes written out above, even if dirstate is never
             # changed after this
             tr.addfilegenerator(
-                b'dirstate',
+                b'dirstate-1-main',
                 (self._filename,),
                 lambda f: self._writedirstate(tr, f),
                 location=b'plain',