Break out of loop correctly when the first file difference is found.
[cvs2svn.git] / cvs2svn_lib / svn_repository_delegate.py
blob9e96decc9dfdfc207ba5319c4a8a6afab26904e0
1 # (Be in -*- python -*- mode.)
3 # ====================================================================
4 # Copyright (c) 2000-2008 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 the SVNRepositoryDelegate class."""
20 class SVNRepositoryDelegate:
21 """Abstract superclass for any delegate to SVNOutputOption.
23 Subclasses must implement all of the methods below.
25 For each method, a subclass implements, in its own way, the
26 Subversion operation implied by the method's name. For example, for
27 the add_path method, the DumpstreamDelegate would write out a
28 'Node-add:' command to a Subversion dumpfile, whereas the
29 StdoutDelegate would merely print that the path is being added to
30 the repository."""
32 def start_commit(self, revnum, revprops):
33 """An SVN commit is starting.
35 Perform any actions needed to start an SVN commit with revision
36 number REVNUM and revision properties REVPROPS."""
38 raise NotImplementedError()
40 def end_commit(self):
41 """An SVN commit is ending."""
43 raise NotImplementedError()
45 def initialize_project(self, project):
46 """Initialize PROJECT.
48 For Subversion, this means to create the trunk, branches, and tags
49 directories for PROJECT."""
51 raise NotImplementedError()
53 def initialize_lod(self, lod):
54 """Initialize LOD with no contents.
56 LOD is an instance of LineOfDevelopment. It is also possible for
57 an LOD to be created by copying from another LOD; such events are
58 indicated via the copy_lod() callback."""
60 raise NotImplementedError()
62 def mkdir(self, lod, cvs_directory):
63 """Create CVS_DIRECTORY within LOD.
65 LOD is a LineOfDevelopment; CVS_DIRECTORY is a CVSDirectory."""
67 raise NotImplementedError()
69 def add_path(self, cvs_rev):
70 """Add the path corresponding to CVS_REV to the repository.
72 CVS_REV is a CVSRevisionAdd."""
74 raise NotImplementedError()
76 def change_path(self, cvs_rev):
77 """Change the path corresponding to CVS_REV in the repository.
79 CVS_REV is a CVSRevisionChange."""
81 raise NotImplementedError()
83 def delete_lod(self, lod):
84 """Delete LOD from the repository.
86 LOD is a LineOfDevelopment instance."""
88 raise NotImplementedError()
90 def delete_path(self, lod, cvs_path):
91 """Delete CVS_PATH from LOD.
93 LOD is a LineOfDevelopment; CVS_PATH is a CVSPath."""
95 raise NotImplementedError()
97 def copy_lod(self, src_lod, dest_lod, src_revnum):
98 """Copy SRC_LOD in SRC_REVNUM to DEST_LOD.
100 SRC_LOD and DEST_LOD are both LODs, and SRC_REVNUM is a subversion
101 revision number (int)."""
103 raise NotImplementedError()
105 def copy_path(self, cvs_path, src_lod, dest_lod, src_revnum):
106 """Copy CVS_PATH in SRC_LOD@SRC_REVNUM to DEST_LOD.
108 CVS_PATH is a CVSPath, SRC_LOD and DEST_LOD are LODs, and
109 SRC_REVNUM is a subversion revision number (int)."""
111 raise NotImplementedError()
113 def finish(self):
114 """All SVN revisions have been committed.
116 Perform any necessary cleanup."""
118 raise NotImplementedError()