GithubHelp home page GithubHelp logo

yasuoka / cvs2gitdump Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 4.0 151 KB

python scripts which import cvs tree into git or subversion repository

Python 90.07% Roff 9.93%
cvs git cvs2git conversion

cvs2gitdump's Introduction

cvs2gitdump.py and cvs2svndump.py can run on Python 3 now. But "rcsparse" doesn't support Python 3 yet. For OpenBSD, use py3-rcsparse-20151027p1 package.

cvs2gitdump

A small python script which imports cvs tree into git repository.

Pros:

  • Small footprint
  • Supports incremental import. It's very fast
  • Converts tags on HEAD
  • Everything is done in memory

Cons:

  • Doesn't convert any branches

An alternative to

Prerequisite:

Usage

usage: cvs2gitdump [-ah] [-z fuzz] [-e email_domain] [-E log_encodings]
    [-k rcs_keywords] [-b branch] [-m module] [-l last_revision]
cvsroot [git_dir]

Options

  • -a

    As the default the script will only use commits 10 minutes older than the most recent commit because recent commits may not stable if the repository is changing. This option will change this behavior, it will use the entire commits.

  • -b branch

    The branch name of the git repository which is used for incremental import.

  • -h

    Show the usage.

  • -z fuzz

    When the script collects changesets from CVS repository, commits by the same author, using the same log message and within fuzz seconds are collected into the same changeset. 300 (seconds) is used as the default.

  • -e email_domain

    Append the email domain to the author.

  • -E log_encodings

    Specify the character encodings used for decoding CVS logs. Multiple encodings can be specified by spearating with ','. Specified encodings are used in order for decoding the log. Default is 'utf-8,iso-8859-1'

  • -k rcs_keywords

    Add an extra RCS keyword which are used by CVS. The script substitutes the RCS keyword by the same way as $Id$.

  • -m module

    Specify the target module name in the target cvsroot. The script will dump only the directory specified by this option.

  • -l last_rev

    Specify the last revision which is used for finding the last change set in the CVS tree. Specify in SHA-1.

  • cvsroot

    The target cvsroot or the sub directory of the cvsroot. The script treats this directory as the root directory.

  • git_dir

    The git repository. Specify this for incremental import.

Example

First import:

% git init --bare /git/openbsd.git
% python cvs2gitdump.py -k OpenBSD -e openbsd.org /cvs/openbsd/src > openbsd.dump
% git --git-dir /git/openbsd.git fast-import < openbsd.dump

Periodic import:

% doas reposync
% python cvs2gitdump.py -k OpenBSD -e openbsd.org /cvs/openbsd/src /git/openbsd.git > openbsd2.dump
% git --git-dir /git/openbsd.git fast-import < openbsd2.dump

cvs2svndump

A small python script which imports cvs tree into subversion repository.

Pros:

  • Small footprint
  • Supports incremental import is supported. It's very fast
  • Everythings is done in memory

Cons:

  • Doesn't convert tags and branches

Prerequirement:

  • rcsparse
  • svn (Python interface for subversion)

Usage

usage: cvs2svndump [-ah] [-z fuzz] [-e email_domain] [-E log_encodings]
[-k rcs_keywords] [-m module] cvsroot [svnroot svnpath]]

Options

  • -a

    As the default the script will only use commits 10 minutes older than the most recent commit because recent commits may not stable if the repository is changing. This option will change this behavior, it will use the entire commits.

  • -h

    Show the usage.

  • -z fuzz

    When the script collects changesets from CVS repository, commits by the same author, using the same log message and within fuzz seconds are collected into the same changeset. 300 (seconds) is used as the default.

  • -e email_domain

    Append the email domain to the author.

  • -E log_encodings

    Specify the character encodings used for decoding CVS logs. Multiple encodings can be specified by spearating with ',' and they are used in order. Default is 'utf-8,iso-8859-1'

  • -k rcs_keywords

    Add an extra RCS keyword which are used by CVS. The script substitutes the RCS keyword by the same way as $Id$.

  • -m module

    Specify the target module name in the target cvsroot. The script will dump only the directory specified by this option.

  • cvsroot

    The target cvsroot or the sub directory of the cvsroot. The script treats this directory as the root directory.

  • svn_dir svn_path

    Specify the svn repository and path. Specify these for incremental import. When the script searches the last commit, it excepts the commits whose author are 'svnadmin'. Use 'svnadmin' for manually fixing.

Example

First import:

% python cvs2svndump.py -k OpenBSD /cvs/openbsd/src > openbsd.dump
% svnadmin create /svnrepo
% svn mkdir --parents -m 'mkdir /vendor/openbsd/head/src' file:///svnrepo/vendor/openbsd/head/src
% svnadmin load --parent-dir /vendor/openbsd/head/src /svnrepo < openbsd.dump

Periodic import:

% doas cvsync
% python cvs2svndump.py -k OpenBSD /cvs/openbsd/src file:///svnrepo vendor/openbsd/head/src > openbsd2.dump
% svnadmin load /svnrepo < openbsd2.dump

cvs2gitdump's People

Contributors

juanfra684 avatar reyk avatar yasuoka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.