Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For now, it does exactly the same as "cvs2svn". This change also adds some minimal test infrastructure for cvs2git, and removes the "XFail" designation from those tests. But the tests only check that cvs2git runs to completion; they do not test the output whatsoever. * cvs2git: New top-level script, for starting conversions 2git or 2hg. * cvs2git-example.options, cvs2hg-example.options, www/cvs2git.html, CHANGES: Document the new script. * cvs2svn_lib/main.py (svn_main, git_main): New functions for starting the corresponding types of conversions. They set up options then call main(). (main): Take options run_options and pass_manager instead of cmd_args. * cvs2svn: Invoke svn_main() instead of main(). * cvs2svn-example.options: Document the new (correct) type of the run_options variable. * cvs2svn_lib/svn_run_options.py, cvs2svn_lib/git_run_options.py: New modules, containing RunOptions classes specific to 2svn and 2git conversions, respectively. For now, these are identical to the common RunOptions class. * cvs2svn_lib/run_options.py: Update module docstring. * run-tests.py (cvs2git): New module-level variable. (run_cvs2git): The 2git analogue of run_cvs2svn(). (GitConversion): New class, the analogue of Conversion (except that it does much less!) (main_git, main_hg): Use the GitConversion class. (test_list): Remove the XFail annotations from main_git and main_hg. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@4744 be7e6eca-30d4-0310-a8e5-ac0d63af7087
- Loading branch information
mhagger
committed
Dec 30, 2008
1 parent
243e0b8
commit 04e13a2
Showing
12 changed files
with
303 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env python | ||
# (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/. | ||
# ==================================================================== | ||
|
||
import sys | ||
|
||
# Make sure that a supported version of Python is being used. Do this | ||
# as early as possible, using only code compatible with Python 1.5.2 | ||
# and Python 3.x before the check. Remember: | ||
# | ||
# Python 1.5.2 doesn't have sys.version_info or ''.join(). | ||
# Python 3.0 doesn't have string.join(). | ||
# There are plans to start deprecating the string formatting '%' | ||
# operator in Python 3.1 (but we use it here anyway). | ||
|
||
version_error = """\ | ||
ERROR: cvs2git requires Python 2, version 2.4 or later; it does not | ||
work with Python 3. You are currently using""" | ||
|
||
version_advice = """\ | ||
Please restart cvs2git using a different version of the Python | ||
interpreter. Visit http://www.python.org or consult your local system | ||
administrator if you need help. | ||
HINT: If you already have a usable Python version installed, it might | ||
be possible to invoke cvs2git with the correct Python interpreter by | ||
typing something like 'python2.5 """ + sys.argv[0] + """ [...]'. | ||
""" | ||
|
||
try: | ||
version = sys.version_info | ||
except AttributeError: | ||
# This is probably a pre-2.0 version of Python. | ||
sys.stderr.write(version_error + '\n') | ||
sys.stderr.write('-'*70 + '\n') | ||
sys.stderr.write(sys.version + '\n') | ||
sys.stderr.write('-'*70 + '\n') | ||
sys.stderr.write(version_advice) | ||
sys.exit(1) | ||
|
||
if not ((2,4) <= version < (3,0)): | ||
sys.stderr.write( | ||
version_error + ' version %d.%d.%d.\n' | ||
% (version[0], version[1], version[2],) | ||
) | ||
sys.stderr.write(version_advice) | ||
sys.exit(1) | ||
|
||
|
||
import os | ||
|
||
from cvs2svn_lib.common import FatalException | ||
from cvs2svn_lib.main import git_main | ||
|
||
|
||
try: | ||
git_main(os.path.basename(sys.argv[0]), sys.argv[1:]) | ||
except FatalException, e: | ||
sys.stderr.write(str(e) + '\n') | ||
sys.exit(1) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# (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 manages cvs2git run options.""" | ||
|
||
|
||
from cvs2svn_lib.run_options import RunOptions | ||
|
||
|
||
class GitRunOptions(RunOptions): | ||
pass | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# (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 manages cvs2svn run options.""" | ||
|
||
|
||
from cvs2svn_lib.run_options import RunOptions | ||
|
||
|
||
class SVNRunOptions(RunOptions): | ||
pass | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.