1 # (Be in -*- python -*- mode.)
3 # ====================================================================
4 # Copyright (c) 2000-2006 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 database facilities used by cvs2svn."""
22 from svn_repository_mirror
import SVNRepositoryMirrorDelegate
25 class StdoutDelegate(SVNRepositoryMirrorDelegate
):
26 """Makes no changes to the disk, but writes out information to
27 STDOUT about what the SVNRepositoryMirror is doing. Of course, our
28 print statements will state that we're doing something, when in
29 reality, we aren't doing anything other than printing out that we're
30 doing something. Kind of zen, really."""
32 def __init__(self
, total_revs
):
33 self
.total_revs
= total_revs
35 def start_commit(self
, svn_commit
):
36 """Prints out the Subversion revision number of the commit that is
39 Log().verbose("=" * 60)
40 Log().normal("Starting Subversion r%d / %d"
41 % (svn_commit
.revnum
, self
.total_revs
))
43 def mkdir(self
, path
):
44 """Print a line stating that we are creating directory PATH."""
46 Log().verbose(" New Directory", path
)
48 def add_path(self
, s_item
):
49 """Print a line stating that we are 'adding' s_item.c_rev.svn_path."""
51 Log().verbose(" Adding", s_item
.c_rev
.svn_path
)
53 def change_path(self
, s_item
):
54 """Print a line stating that we are 'changing' s_item.c_rev.svn_path."""
56 Log().verbose(" Changing", s_item
.c_rev
.svn_path
)
58 def delete_path(self
, path
):
59 """Print a line stating that we are 'deleting' PATH."""
61 Log().verbose(" Deleting", path
)
63 def copy_path(self
, src_path
, dest_path
, src_revnum
):
64 """Print a line stating that we are 'copying' revision SRC_REVNUM
65 of SRC_PATH to DEST_PATH."""
67 Log().verbose(" Copying revision", src_revnum
, "of", src_path
)
68 Log().verbose(" to", dest_path
)
71 """State that we are done creating our repository."""
73 Log().verbose("Finished creating Subversion repository.")