Mercurial > hg
changeset 29297:50fef8252820
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.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Sat, 16 Apr 2016 16:01:24 -0700 |
parents | 9b41cfe0af31 |
children | 82f6193ff2bc |
files | mercurial/transaction.py |
diffstat | 1 files changed, 8 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/transaction.py Sat Apr 16 15:59:30 2016 -0700 +++ b/mercurial/transaction.py Sat Apr 16 16:01:24 2016 -0700 @@ -31,10 +31,9 @@ '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 @@ # 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 @@ 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 @@ '''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: