Extract functions generate_edits_from_blocks() and write_edits().
[cvs2svn.git] / cvs2svn_lib / output_option.py
blob70419e672f3ae07b4dad745563cd0b191335fd96
1 # (Be in -*- python -*- mode.)
3 # ====================================================================
4 # Copyright (c) 2000-2009 CollabNet. All rights reserved.
6 # This software is licensed as described in the file COPYING, which
7 # you should have received as part of this distribution. The terms
8 # are also available at http://subversion.tigris.org/license-1.html.
9 # If newer versions of this license are posted there, you may use a
10 # newer version instead, at your option.
12 # This software consists of voluntary contributions made by many
13 # individuals. For exact contribution history, see the revision
14 # history and logs, available at http://cvs2svn.tigris.org/.
15 # ====================================================================
17 """This module contains classes that hold the cvs2svn output options."""
20 class OutputOption:
21 """Represents an output choice for a run of cvs2svn."""
23 def register_artifacts(self, which_pass):
24 """Register artifacts that will be needed for this output option.
26 WHICH_PASS is the pass that will call our callbacks, so it should
27 be used to do the registering (e.g., call
28 WHICH_PASS.register_temp_file() and/or
29 WHICH_PASS.register_temp_file_needed())."""
31 pass
33 def check(self):
34 """Check that the options stored in SELF are sensible.
36 This might including the existence of a repository on disk, etc."""
38 raise NotImplementedError()
40 def check_symbols(self, symbol_map):
41 """Check that the symbols in SYMBOL_MAP are OK for this output option.
43 SYMBOL_MAP is a map {AbstractSymbol : (Trunk|TypedSymbol)},
44 indicating how each symbol is planned to be converted. Raise a
45 FatalError if the symbol plan is not acceptable for this output
46 option."""
48 raise NotImplementedError()
50 def setup(self, svn_rev_count):
51 """Prepare this output option."""
53 raise NotImplementedError()
55 def process_initial_project_commit(self, svn_commit):
56 """Process SVN_COMMIT, which is an SVNInitialProjectCommit."""
58 raise NotImplementedError()
60 def process_primary_commit(self, svn_commit):
61 """Process SVN_COMMIT, which is an SVNPrimaryCommit."""
63 raise NotImplementedError()
65 def process_post_commit(self, svn_commit):
66 """Process SVN_COMMIT, which is an SVNPostCommit."""
68 raise NotImplementedError()
70 def process_branch_commit(self, svn_commit):
71 """Process SVN_COMMIT, which is an SVNBranchCommit."""
73 raise NotImplementedError()
75 def process_tag_commit(self, svn_commit):
76 """Process SVN_COMMIT, which is an SVNTagCommit."""
78 raise NotImplementedError()
80 def cleanup(self):
81 """Perform any required cleanup related to this output option."""
83 raise NotImplementedError()