82
82
def tag_handler(self, cmd):
83
83
"""Process a TagCommand."""
84
84
raise NotImplementedError(self.tag_handler)
87
class CommitHandler(object):
88
"""Base class for commit handling.
90
Subclasses should override the pre_*, post_* and *_handler
91
methods as appropriate.
94
def __init__(self, command):
95
self.command = command
98
self.pre_process_files()
99
for fc in self.command.file_iter():
101
handler = self.__class__.__dict__[fc.name + "_handler"]
103
raise errors.MissingHandler(fc.name)
106
self.post_process_files()
108
def pre_process_files(self):
109
"""Prepare for committing."""
112
def post_process_files(self):
113
"""Save the revision."""
116
def modify_handler(self, filecmd):
117
"""Handle a filemodify command."""
118
raise NotImplementedError(self.modify_handler)
120
def delete_handler(self, filecmd):
121
"""Handle a filedelete command."""
122
raise NotImplementedError(self.delete_handler)
124
def copy_handler(self, filecmd):
125
"""Handle a filecopy command."""
126
raise NotImplementedError(self.copy_handler)
128
def rename_handler(self, filecmd):
129
"""Handle a filerename command."""
130
raise NotImplementedError(self.rename_handler)
132
def deleteall_handler(self, filecmd):
133
"""Handle a filedeleteall command."""
134
raise NotImplementedError(self.deleteall_handler)