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 writes out a 'Node-add:'
28 command to a Subversion dumpfile."""
30 def start_commit(self
, revnum
, revprops
):
31 """An SVN commit is starting.
33 Perform any actions needed to start an SVN commit with revision
34 number REVNUM and revision properties REVPROPS."""
36 raise NotImplementedError()
39 """An SVN commit is ending."""
41 raise NotImplementedError()
43 def initialize_project(self
, project
):
44 """Initialize PROJECT.
46 For Subversion, this means to create the trunk, branches, and tags
47 directories for PROJECT."""
49 raise NotImplementedError()
51 def initialize_lod(self
, lod
):
52 """Initialize LOD with no contents.
54 LOD is an instance of LineOfDevelopment. It is also possible for
55 an LOD to be created by copying from another LOD; such events are
56 indicated via the copy_lod() callback."""
58 raise NotImplementedError()
60 def mkdir(self
, lod
, cvs_directory
):
61 """Create CVS_DIRECTORY within LOD.
63 LOD is a LineOfDevelopment; CVS_DIRECTORY is a CVSDirectory."""
65 raise NotImplementedError()
67 def add_path(self
, cvs_rev
):
68 """Add the path corresponding to CVS_REV to the repository.
70 CVS_REV is a CVSRevisionAdd."""
72 raise NotImplementedError()
74 def change_path(self
, cvs_rev
):
75 """Change the path corresponding to CVS_REV in the repository.
77 CVS_REV is a CVSRevisionChange."""
79 raise NotImplementedError()
81 def delete_lod(self
, lod
):
82 """Delete LOD from the repository.
84 LOD is a LineOfDevelopment instance."""
86 raise NotImplementedError()
88 def delete_path(self
, lod
, cvs_path
):
89 """Delete CVS_PATH from LOD.
91 LOD is a LineOfDevelopment; CVS_PATH is a CVSPath."""
93 raise NotImplementedError()
95 def copy_lod(self
, src_lod
, dest_lod
, src_revnum
):
96 """Copy SRC_LOD in SRC_REVNUM to DEST_LOD.
98 SRC_LOD and DEST_LOD are both LODs, and SRC_REVNUM is a subversion
99 revision number (int)."""
101 raise NotImplementedError()
103 def copy_path(self
, cvs_path
, src_lod
, dest_lod
, src_revnum
):
104 """Copy CVS_PATH in SRC_LOD@SRC_REVNUM to DEST_LOD.
106 CVS_PATH is a CVSPath, SRC_LOD and DEST_LOD are LODs, and
107 SRC_REVNUM is a subversion revision number (int)."""
109 raise NotImplementedError()
112 """All SVN revisions have been committed.
114 Perform any necessary cleanup."""
116 raise NotImplementedError()