# HG changeset patch # User Pierre-Yves David # Date 2016-04-16 23:01:24 # Node ID 50fef8252820d19b0e7a3021bf0f4523379d6460 # Parent 9b41cfe0af3140bae9ed8749d5b8fca23dd7c0c2 style: remove namespace class For better or worse, our coding do not use use class for pure namespacing. We remove the class introduced in a5009789960c. diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -31,10 +31,9 @@ postfinalizegenerators = set([ 'dirstate' ]) -class GenerationGroup(object): - all='all' - prefinalize='prefinalize' - postfinalize='postfinalize' +gengroupall='all' +gengroupprefinalize='prefinalize' +gengrouppostfinalize='postfinalize' def active(func): def _active(self, *args, **kwds): @@ -289,7 +288,7 @@ class transaction(object): # 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=gengroupall): # write files registered for generation any = False for id, entry in sorted(self._filegenerators.iteritems()): @@ -297,8 +296,8 @@ class transaction(object): 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 == gengrouppostfinalize + if (group != gengroupall and (id in postfinalizegenerators) != (postfinalize)): continue @@ -427,13 +426,13 @@ class transaction(object): '''commit the transaction''' if self.count == 1: self.validator(self) # will raise exception if needed - self._generatefiles(group=GenerationGroup.prefinalize) + self._generatefiles(group=gengroupprefinalize) 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=gengrouppostfinalize) self.count -= 1 if self.count != 0: