### Compile and Install gdbm Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Compile and install the gdbm library after configuring and modifying the Makefile. Use sudo for installation. ```bash make ``` ```bash sudo make install ``` -------------------------------- ### Enable Shared Libraries in Python Setup Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Uncomment the '*shared*' line in Python's Setup file to enable the creation of shared libraries. ```python *shared* ``` -------------------------------- ### Install cvs2svn Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Install cvs2svn after compiling Python with gdbm support. Use sudo for the installation command. ```bash sudo make install ``` -------------------------------- ### Run cvs2git with Command-Line Options Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2git.html This example demonstrates how to run cvs2git using command-line arguments to specify output files and the CVS repository path. Ensure the specified paths for blobfile and dumpfile exist or can be created. ```bash cvs2git \ --blobfile=cvs2git-tmp/git-blob.dat \ --dumpfile=cvs2git-tmp/git-dump.dat \ --username=cvs2git \ /path/to/cvs/repo ``` -------------------------------- ### Starting a cvs2svn conversion with an options file Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2svn.md Invoke cvs2svn using the --options flag followed by the path to your options file. Only specific options are allowed in conjunction with --options. ```bash $ cvs2svn --options=OPTIONSFILE ``` -------------------------------- ### Create Python Symlink Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Create a symbolic link for the newly installed Python version in /usr/local/bin to ensure it's the default. ```bash cd /usr/local/bin; sudo ln -s python2.6 python ``` -------------------------------- ### Enable gdbm Support in Python Setup Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Uncomment the gdbm linking line in Python's Setup file to enable gdbm module support during compilation. ```python gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm ``` -------------------------------- ### Run cvs2git with Options File Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2git.html This command invokes cvs2git using a configuration file, which offers more flexibility than command-line options. Use 'cvs2git-example.options' as a starting point for your configuration. ```bash cvs2git --options=OPTIONS-FILE ``` -------------------------------- ### Clone a bare Git repository Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2git.html Clones a bare Git repository into a new directory, creating a non-bare repository with a checked-out working tree. This is for starting development. ```bash git clone /path/to/myproject.git ``` -------------------------------- ### Modify gdbm Makefile Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Adjust the BINOWN and BINGRP variables in the gdbm Makefile to prevent installation issues related to non-existent users/groups. ```makefile BINOWN = root BINGRP = admin ``` -------------------------------- ### Test Distribution and Unit Tests Source: https://github.com/mhagger/cvs2svn/blob/master/doc/making-releases.txt After creating a trial distribution, unpack it, run the unit tests, and then clean up the unpacked directory. ```bash ./dist.sh tar -xzf cvs2svn-A.B.C-dev.tar.gz cd cvs2svn-A.B.C-dev ./run-tests.py cd .. rm -rf cvs2svn-A.B.C-dev ``` -------------------------------- ### Initialize a bare Git repository Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2git.html Initializes a new bare Git repository at the specified path and changes the current directory to it. Use this for server-side repositories. ```bash git init --bare /path/to/myproject.git cd /path/to/myproject.git ``` -------------------------------- ### Create a new Subversion repository Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Use this command to initialize a new Subversion repository if one does not already exist. Ensure you have the necessary permissions to create directories and files at the specified path. ```bash svnadmin create /path/to/svnrepos ``` -------------------------------- ### Running cvs2bzr with an Options File Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2bzr.html This command initiates the cvs2bzr conversion process using a specified options file for configuration. The options file allows for more flexible configuration compared to command-line arguments. ```bash cvs2bzr --options=OPTIONS-FILE ``` -------------------------------- ### Initialize a non-bare Git repository Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2git.html Initializes a new Git repository at the specified path without the --bare option, creating a working tree. Use this for direct development. ```bash git init /path/to/myproject.git cd /path/to/myproject.git ``` -------------------------------- ### Example cvs2svn bug reproduction script Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md This shell script serves as a test case for shrink_test_case.py. It exits successfully (0) if the specified 'KeyError' is found in the cvs2svn dry-run output, indicating the bug is still present. Otherwise, it fails (1). ```bash #! /bin/sh cvs2svn --dry-run /path/to/copy/of/repo 2>&1 | grep -q 'KeyError' ``` -------------------------------- ### Use Options File for Configuration Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2svn.md Specify an options file to define all conversion parameters for cvs2svn. This allows for complex configurations to be managed in a separate file. ```bash $ cvs2svn --options OPTIONSFILE ``` -------------------------------- ### Configure Python Source for OS X Framework Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Configure the Python source build with options for OS X framework and universal SDK support. Adjust --disable-universalsdk if needed. ```bash ./configure --enable-framework --enable-universalsdk ``` -------------------------------- ### Run shrink_test_case.py script Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Execute the shrink_test_case.py script with the repository backup and the test script as arguments. This script iteratively reduces the repository size while ensuring the bug persists. ```bash # You did make a backup, right? /path/to/config/shrink_test_case.py /path/to/copy/of/repo testscript.sh ``` -------------------------------- ### View Git repository with all branches Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2git.html Opens the gitk graphical viewer to display all branches of the repository, useful for reviewing the conversion results. ```bash gitk --all ``` -------------------------------- ### Configure gdbm Source Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Configure the gdbm source code before compilation. Ensure you adjust Makefile permissions if necessary. ```bash ./configure ``` -------------------------------- ### Create New Subversion Repository Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2svn.md Use this command to create a new Subversion repository by converting an existing CVS repository. Specify the output repository path and the source CVS repository path. ```bash $ cvs2svn --svnrepos NEW_SVNREPOS CVSREPOS ``` -------------------------------- ### Create cvs2svn Symlinks Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Create symbolic links for cvs2svn, its libraries, and include directories in /usr/local/bin and other standard locations to make them accessible. ```bash sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/cvs2svn /usr/local/bin/cvs2svn sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /usr/local/lib/python2.6 sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 /usr/local/include/python2.6 ``` -------------------------------- ### Run destroy_repository.py script Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Use this command to execute the destroy_repository.py script on a backup of your repository. Ensure you have a backup before running this script, as it will destroy the original repository. ```bash # You did make a backup, right? /path/to/config/destroy_repository.py /path/to/copy/of/repo ``` -------------------------------- ### Load dump files using cat and git fast-import Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2git.html A Linux/Unix shortcut to load cvs2git dump files by concatenating them and piping the output to git fast-import. ```bash cat ../cvs2git-tmp/git-blob.dat ../cvs2git-tmp/git-dump.dat | git fast-import ``` -------------------------------- ### Loading cvs2bzr Dump File into Bazaar Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2bzr.html This command loads the generated fast-import format dump file into a new Bazaar project repository. Ensure the dump file path and the target project name are correctly specified. ```bash bzr fast-import cvs2svn-tmp/dumpfile.fi project.bzr ``` -------------------------------- ### Create Release Tag Source: https://github.com/mhagger/cvs2svn/blob/master/doc/making-releases.txt After setting the version in cvs2svn_lib/version.py, create a tag in Subversion for the release. ```bash svn copy . http://cvs2svn.tigris.org/svn/cvs2svn/tags/A.B.C ``` -------------------------------- ### Add Multiple Projects to cvs2svn Options Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Use `run_options.add_project()` for each sub-project when converting multiple projects simultaneously. This configures the mapping from CVS paths to Subversion repository structure. ```python run_options.add_project( 'my/cvsrepo/project-a', trunk_path='project-a/trunk', branches_path='project-a/branches', tags_path='project-a/tags', symbol_transforms=[ #...whatever... ], symbol_strategy_rules=[ #...whatever... ], ) run_options.add_project( 'my/cvsrepo/project-b', trunk_path='project-b/trunk', branches_path='project-b/branches', tags_path='project-b/tags', symbol_transforms=[ #...whatever... ], symbol_strategy_rules=[ #...whatever... ], ) ``` -------------------------------- ### Automate cvs2svn Options File with Python Loop Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Automate the addition of numerous subprojects to the options file using a Python loop. This is useful when dealing with a large number of projects to convert. ```python projects = ['A', 'B', 'C', ...etc...] cvs_repo_main_dir = r'test-data/main-cvsrepos' for project in projects: run_options.add_project( cvs_repo_main_dir + '/' + project, trunk_path=(project + '/trunk'), branches_path=(project + '/branches'), tags_path=(project + '/tags'), # ... ) ``` ```python import os cvs_repo_main_dir = r'test-data/main-cvsrepos' projects = os.listdir(cvs_repo_main_dir) # Probably you don't want to convert CVSROOT: projects.remove('CVSROOT') for project in projects: # ...as above... ``` -------------------------------- ### Running cvs2svn in a Docker Container Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2svn.md This command demonstrates how to build a Docker image for cvs2svn and then run it. It mounts the local CVS repository and temporary directories into the container. ```bash make docker-image docker run -it --rm \ --mount 'src=/path/to/my/cvs,dst=/cvs,readonly' \ --mount 'type=volume,src=/tmp,dst=/tmp' \ cvs2svn [OPTS] /cvs ``` -------------------------------- ### Web Release Announcement Template Source: https://github.com/mhagger/cvs2svn/blob/master/doc/making-releases.txt Template for a web-based release announcement, including links to the CHANGES file and download. ```html cvs2svn VERSION is now released. <br /> The MD5 checksum is CHECKSUM <br /> For more information see <a href="http://cvs2svn.tigris.org/source/browse/cvs2svn/tags/VERSION/CHANGES?view=markup" >CHANGES</a>. <br /> Download: <a href="http://cvs2svn.tigris.org/files/documents/1462/NNNNN/cvs2svn-VERSION.tar.gz" >cvs2svn-VERSION.tar.gz</a>. ``` -------------------------------- ### Configure Single Project Paths in cvs2svn Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Specify custom paths for trunk, branches, and tags within a single project conversion. This is done either via command-line arguments or within the options file. ```bash $ cvs2svn --trunk=foo/trunk --branches=foo/branches --tags=foo/tags CVSREPO/foo ``` ```python run_options.add_project( 'my/cvsrepo/foo', trunk_path='foo/trunk', branches_path='foo/branches', tags_path='foo/tags', symbol_transforms=[ #...whatever... ], symbol_strategy_rules=[ #...whatever... ], ) ``` -------------------------------- ### Update Shell Profile Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md Ensure /usr/local/bin is at the front of your system's search path by updating your shell profile (e.g., ~/.profile or ~/.bashrc) and sourcing it. ```bash source ~/.profile ``` -------------------------------- ### Create Subversion Dumpfile Source: https://github.com/mhagger/cvs2svn/blob/master/cvs2svn.md Generate a Subversion dumpfile, suitable for 'svnadmin load', from a CVS repository. This is useful for migrating repositories or creating backups. ```bash $ cvs2svn --dumpfile DUMPFILE CVSREPOS ``` -------------------------------- ### Load a Subversion dumpfile into a repository Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md This command imports the contents of a Subversion dumpfile into an existing Subversion repository. Navigate to a directory where you can manage dump files before executing this command. ```bash $ svnadmin load /path/to/svnrepos Allow RegexpSymbolTransform to transform the symbol: return RegexpSymbolTransform.transform( self, cvs_file, symbol_name, revision) else: # No -> Return the symbol unchanged: return symbol_name # Note that we use a Python loop to fill the list of symbol_transforms: symbol_transforms = [] for subdir in ['project1', 'project2', 'project3']: symbol_transforms.append( MySymbolTransform( subdir, r'release-(\d+)_(\d+)', r'%s-release-\1.\2' % subdir)) # Now register the project, using our own symbol transforms: run_options.add_project( 'your_cvs_path', trunk_path='trunk', branches_path='branches', tags_path='tags', symbol_transforms=symbol_transforms)) ``` -------------------------------- ### Custom File Property Setter in Python Source: https://github.com/mhagger/cvs2svn/blob/master/faq.md For advanced control, define a custom FilePropertySetter in Python to programmatically set Subversion properties like svn:mime-type and svn:eol-style based on file paths or other criteria. The class must be defined in a separate file. ```python from cvs2svn_lib.property_setters import FilePropertySetter class MyPropertySetter(FilePropertySetter): def set_properties(self, cvs_file): if cvs_file.cvs_path.startswith('path/to/funny/files/'): cvs_file.properties['svn:mime-type'] = 'text/plain' cvs_file.properties['svn:eol-style'] = 'CRLF' ctx.file_property_setters.append(MyPropertySetter()) ```