##// END OF EJS Templates
style: remove namespace class...
Pierre-Yves David -
r29297:50fef825 default
parent child Browse files
Show More
@@ -31,10 +31,9 b' postfinalizegenerators = set(['
31 'dirstate'
31 'dirstate'
32 ])
32 ])
33
33
34 class GenerationGroup(object):
34 gengroupall='all'
35 all='all'
35 gengroupprefinalize='prefinalize'
36 prefinalize='prefinalize'
36 gengrouppostfinalize='postfinalize'
37 postfinalize='postfinalize'
38
37
39 def active(func):
38 def active(func):
40 def _active(self, *args, **kwds):
39 def _active(self, *args, **kwds):
@@ -289,7 +288,7 b' class transaction(object):'
289 # but for bookmarks that are handled outside this mechanism.
288 # but for bookmarks that are handled outside this mechanism.
290 self._filegenerators[genid] = (order, filenames, genfunc, location)
289 self._filegenerators[genid] = (order, filenames, genfunc, location)
291
290
292 def _generatefiles(self, suffix='', group=GenerationGroup.all):
291 def _generatefiles(self, suffix='', group=gengroupall):
293 # write files registered for generation
292 # write files registered for generation
294 any = False
293 any = False
295 for id, entry in sorted(self._filegenerators.iteritems()):
294 for id, entry in sorted(self._filegenerators.iteritems()):
@@ -297,8 +296,8 b' class transaction(object):'
297 order, filenames, genfunc, location = entry
296 order, filenames, genfunc, location = entry
298
297
299 # for generation at closing, check if it's before or after finalize
298 # for generation at closing, check if it's before or after finalize
300 postfinalize = group == GenerationGroup.postfinalize
299 postfinalize = group == gengrouppostfinalize
301 if (group != GenerationGroup.all and
300 if (group != gengroupall and
302 (id in postfinalizegenerators) != (postfinalize)):
301 (id in postfinalizegenerators) != (postfinalize)):
303 continue
302 continue
304
303
@@ -427,13 +426,13 b' class transaction(object):'
427 '''commit the transaction'''
426 '''commit the transaction'''
428 if self.count == 1:
427 if self.count == 1:
429 self.validator(self) # will raise exception if needed
428 self.validator(self) # will raise exception if needed
430 self._generatefiles(group=GenerationGroup.prefinalize)
429 self._generatefiles(group=gengroupprefinalize)
431 categories = sorted(self._finalizecallback)
430 categories = sorted(self._finalizecallback)
432 for cat in categories:
431 for cat in categories:
433 self._finalizecallback[cat](self)
432 self._finalizecallback[cat](self)
434 # Prevent double usage and help clear cycles.
433 # Prevent double usage and help clear cycles.
435 self._finalizecallback = None
434 self._finalizecallback = None
436 self._generatefiles(group=GenerationGroup.postfinalize)
435 self._generatefiles(group=gengrouppostfinalize)
437
436
438 self.count -= 1
437 self.count -= 1
439 if self.count != 0:
438 if self.count != 0:
General Comments 0
You need to be logged in to leave comments. Login now