Patchwork D8175: transaction: move constant to upper case

login
register
mail settings
Submitter phabricator
Date Feb. 28, 2020, 7:14 p.m.
Message ID <5825db749943a6bf9a23939c9dccf964@localhost.localdomain>
Download mbox | patch
Permalink /patch/45404/
State Not Applicable
Headers show

Comments

phabricator - Feb. 28, 2020, 7:14 p.m.
Closed by commit rHGbaf8c3f944eb: transaction: move constant to upper case (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8175?vs=20369&id=20398

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8175/new/

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

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -30,9 +30,9 @@ 
 # the changelog having been written).
 postfinalizegenerators = {b'bookmarks', b'dirstate'}
 
-gengroupall = b'all'
-gengroupprefinalize = b'prefinalize'
-gengrouppostfinalize = b'postfinalize'
+GEN_GROUP_ALL = b'all'
+GEN_GROUP_PRE_FINALIZE = b'prefinalize'
+GEN_GROUP_POST_FINALIZE = b'postfinalize'
 
 
 def active(func):
@@ -352,7 +352,7 @@ 
         if genid in self._filegenerators:
             del self._filegenerators[genid]
 
-    def _generatefiles(self, suffix=b'', group=gengroupall):
+    def _generatefiles(self, suffix=b'', group=GEN_GROUP_ALL):
         # write files registered for generation
         any = False
         for id, entry in sorted(pycompat.iteritems(self._filegenerators)):
@@ -360,9 +360,9 @@ 
             order, filenames, genfunc, location = entry
 
             # for generation at closing, check if it's before or after finalize
-            postfinalize = group == gengrouppostfinalize
+            postfinalize = group == GEN_GROUP_POST_FINALIZE
             if (
-                group != gengroupall
+                group != GEN_GROUP_ALL
                 and (id in postfinalizegenerators) != postfinalize
             ):
                 continue
@@ -505,7 +505,7 @@ 
         if self._count == 1:
             self._validator(self)  # will raise exception if needed
             self._validator = None  # Help prevent cycles.
-            self._generatefiles(group=gengroupprefinalize)
+            self._generatefiles(group=GEN_GROUP_PRE_FINALIZE)
             while self._finalizecallback:
                 callbacks = self._finalizecallback
                 self._finalizecallback = {}
@@ -514,7 +514,7 @@ 
                     callbacks[cat](self)
             # Prevent double usage and help clear cycles.
             self._finalizecallback = None
-            self._generatefiles(group=gengrouppostfinalize)
+            self._generatefiles(group=GEN_GROUP_POST_FINALIZE)
 
         self._count -= 1
         if self._count != 0: