style: don't use capital letter for constant
For better or worse, our coding do not use all caps for constants. We rename
constant name introduced in
a5009789960c.
--- a/mercurial/transaction.py Sat Jun 04 11:16:08 2016 -0700
+++ b/mercurial/transaction.py Sat Apr 16 15:59:30 2016 -0700
@@ -32,9 +32,9 @@
])
class GenerationGroup(object):
- ALL='all'
- PREFINALIZE='prefinalize'
- POSTFINALIZE='postfinalize'
+ all='all'
+ prefinalize='prefinalize'
+ postfinalize='postfinalize'
def active(func):
def _active(self, *args, **kwds):
@@ -289,7 +289,7 @@
# but for bookmarks that are handled outside this mechanism.
self._filegenerators[genid] = (order, filenames, genfunc, location)
- def _generatefiles(self, suffix='', group=GenerationGroup.ALL):
+ def _generatefiles(self, suffix='', group=GenerationGroup.all):
# write files registered for generation
any = False
for id, entry in sorted(self._filegenerators.iteritems()):
@@ -297,8 +297,8 @@
order, filenames, genfunc, location = entry
# for generation at closing, check if it's before or after finalize
- postfinalize = group == GenerationGroup.POSTFINALIZE
- if (group != GenerationGroup.ALL and
+ postfinalize = group == GenerationGroup.postfinalize
+ if (group != GenerationGroup.all and
(id in postfinalizegenerators) != (postfinalize)):
continue
@@ -427,13 +427,13 @@
'''commit the transaction'''
if self.count == 1:
self.validator(self) # will raise exception if needed
- self._generatefiles(group=GenerationGroup.PREFINALIZE)
+ self._generatefiles(group=GenerationGroup.prefinalize)
categories = sorted(self._finalizecallback)
for cat in categories:
self._finalizecallback[cat](self)
# Prevent double usage and help clear cycles.
self._finalizecallback = None
- self._generatefiles(group=GenerationGroup.POSTFINALIZE)
+ self._generatefiles(group=GenerationGroup.postfinalize)
self.count -= 1
if self.count != 0: