Giter Site home page Giter Site logo

git-svn-trac's Introduction

svn-git-trac - Migrate Trac Tickets Referencing Svn to Git

Will replace all texts in ticket and ticket_changes that reference svn (like [12345]) to the git hash equivalent (like [changeset:0a1bc3f]). Uses sqlalchemy.core for db backend abstraction which enables it to connect to all databases supported by trac.

Requirements

  • OSX / Linux
  • Python 2.7

Git Svn Repository

For this script to work a git repository must exist on the local machine which was created using git svn clone with metadata intact. To see if your git folder fulfills this requirement try to run the following command:

git svn log --oneline --show-commit

If this command, run in the git folder, returns something along these lines:

r12345 | 0abc123 | Fixed the flux capacitator
...

Then you are good to go!

After running this script, be sure to do the following in Trac:

trac-admin config set git wikishortrev_len 7 trac-admin repository resync "*"

Installation

  1. Create a Virtual Environment

    mkdir git-svn-trac cd git-svn-trac virtualenv --no-site-packages -p python2.7 . source bin/activate

  2. Run pip, using the requirements fitting for your database

    pip install -r mysql-requirements.txt or pip install -r sqlite-requirements.txt or pip install -r postgres-requirements.txt

  3. Create a backup of your git folder and database!

Usage

python git-svn-trac.py gitfolder dsn

Examples

python git-svn-trac.py ~/helloworld/ mysql+pymysql://user:password@localhost/trac

python git-svn-trac.py ~/project/ sqlite:///home/user/trac.db

python git-svn-trac.py ~/project/ postgres+psycopg2://user:password@localhsot/trac

Author

Denis Krienbühl for Seantis GmbH

License

Public Domain

This program is free software. It comes without any warranty!

git-svn-trac's People

Contributors

href avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

git-svn-trac's Issues

Links To Changesets Not Updated

Links to changesets are not properly updated. And if that is fixed, the link is not set, since the text "changeset:" is missing.

Bugfix 1: Regular expression on line 64 is missing a quote. Even better: specify the quotes as optional.
Bugfix 2: Add the text "changeset:" on line 74

Please apply the attached patch: patch.txt

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.