/usr/lib/python2.7/dist-packages/cvs2svn_lib/revision_manager.py is in cvs2svn 2.4.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | # (Be in -*- python -*- mode.)
#
# ====================================================================
# Copyright (c) 2000-2008 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision
# history and logs, available at http://cvs2svn.tigris.org/.
# ====================================================================
"""This module describes the interface to the CVS repository."""
class RevisionCollector(object):
"""Optionally collect revision information for CVS files."""
def __init__(self):
"""Initialize the RevisionCollector.
Please note that a RevisionCollector is instantiated in every
program run, even if the data-collection pass will not be
executed. (This is to allow it to register the artifacts that it
produces.) Therefore, the __init__() method should not do much,
and more substantial preparation for use (like actually creating
the artifacts) should be done in start()."""
pass
def register_artifacts(self, which_pass):
"""Register artifacts that will be needed while collecting data.
WHICH_PASS is the pass that will call our callbacks, so it should
be used to do the registering (e.g., call
WHICH_PASS.register_temp_file() and/or
WHICH_PASS.register_temp_file_needed())."""
pass
def start(self):
"""Data will soon start being collected.
Any non-idempotent initialization should be done here."""
pass
def process_file(self, cvs_file_items):
"""Collect data for the file described by CVS_FILE_ITEMS.
CVS_FILE_ITEMS has already been transformed into the logical
representation of the file's history as it should be output.
Therefore it is not necessarily identical to the history as
recorded in the RCS file.
This method is allowed to store a pickleable object to the
CVSItem.revision_reader_token member of CVSItems in
CVS_FILE_ITEMS. These data are stored with the items and
available for the use of the RevisionReader."""
raise NotImplementedError()
def finish(self):
"""All recording is done; clean up."""
pass
class NullRevisionCollector(RevisionCollector):
"""A do-nothing variety of RevisionCollector."""
def process_file(self, cvs_file_items):
pass
class RevisionReader(object):
"""An object that can read the contents of CVSRevisions."""
def register_artifacts(self, which_pass):
"""Register artifacts that will be needed during branch exclusion.
WHICH_PASS is the pass that will call our callbacks, so it should
be used to do the registering (e.g., call
WHICH_PASS.register_temp_file() and/or
WHICH_PASS.register_temp_file_needed())."""
pass
def start(self):
"""Prepare for calls to get_content()."""
pass
def get_content(self, cvs_rev):
"""Return the contents of CVS_REV.
CVS_REV is a CVSRevision. The way that the contents are extracted
is influenced by properties that are set on CVS_REV:
* The CVS_REV property _keyword_handling specifies how RCS/CVS
keywords should be handled:
* 'collapsed' -- collapse RCS/CVS keywords in the output; e.g.,
'$Author: jrandom $' -> '$Author$'.
* 'expanded' -- expand RCS/CVS keywords in the output; e.g.,
'$Author$' -> '$Author: jrandom $'.
* 'untouched' -- leave RCS/CVS keywords untouched. For a file
that had keyword expansion enabled in CVS, this typically
means that the keyword comes out expanded as for the
*previous* revision, because CVS expands keywords on checkout,
not checkin.
* unset -- undefined behavior; depends on which revision manager
is being used.
* The CVS_REV property _eol_fix specifies how EOL sequences should
be handled in the output. If the property is unset or empty,
then leave EOL sequences untouched. If it is non-empty, then
convert all end-of-line sequences to the value of that property
(typically '\n' or '\r\n').
See doc/properties.txt and doc/text-transformations.txt for more
information.
If Ctx().decode_apple_single is set, then extract the data fork
from any content that looks like AppleSingle format."""
raise NotImplementedError()
def finish(self):
"""Inform the reader that all calls to get_content() are done.
Start may be called again at a later point."""
pass
|