Add option for excluding paths from conversion
[cvs2svn.git] / cvs2svn_lib / rcs_revision_manager.py
blob08d792ecf62e1fa67336adb4f5f4e35b9c6cece1
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 """Access the CVS repository via RCS's 'co' command."""
20 from cvs2svn_lib.common import FatalError
21 from cvs2svn_lib.process import check_command_runs
22 from cvs2svn_lib.process import CommandFailedException
23 from cvs2svn_lib.abstract_rcs_revision_manager import AbstractRCSRevisionReader
26 class RCSRevisionReader(AbstractRCSRevisionReader):
27 """A RevisionReader that reads the contents via RCS."""
29 def __init__(self, co_executable):
30 self.co_executable = co_executable
31 try:
32 check_command_runs([self.co_executable, '-V'], self.co_executable)
33 except CommandFailedException, e:
34 raise FatalError('%s\n'
35 'Please check that co is installed and in your PATH\n'
36 '(it is a part of the RCS software).' % (e,))
38 def get_pipe_command(self, cvs_rev, k_option):
39 return [
40 self.co_executable,
41 '-q',
42 '-x,v',
43 '-p%s' % (cvs_rev.rev,)
44 ] + k_option + [
45 cvs_rev.cvs_file.rcs_path