Skip to content
Snippets Groups Projects
Commit baf8c3f9 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

transaction: move constant to upper case

These constant are internal to the module and can be safely renamed. Having them
upper case help to clarify their "constant" status.

(This is a gratuitous cleanup I did while looking at something else.)

Differential Revision: https://phab.mercurial-scm.org/D8175
parent a1908951
No related branches found
No related tags found
No related merge requests found
......@@ -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,5 +360,5 @@
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 (
......@@ -364,5 +364,5 @@
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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment