Giter VIP home page Giter VIP logo

svndumptransformer's Introduction

svndumptransformer

Transform SVN dump files - rename contents.

This tool can replace both paths (i.e. file and directory names) as well as content. It is thus suitable to rename a product including all classes in a source code (the references to the classes would be renamed, too, of course).

Usage

java -jar co.codewizards.svndumptransformer-1.0.jar INPUTFILE OUTPUTFILE REPLACEMENTS

INPUTFILE

The SVN dump file to be read (generated by 'svnadmin dump'). Relative or absolute path.

OUTPUTFILE

The destination file into which the transformed dump is written. Relative or absolute path.

REPLACEMENTS

Pairs of strings to be replaced. Each 1st value is a string to be searched and replaced by the corresponding 2nd value. This is case-sensitive!

The replacement-pairs are applied in the same order in which they're specified here.

Example

java -jar co.codewizards.svndumptransformer-1.0.jar oldproduct.svndump newproduct.svndump OldProduct NewProduct oldProduct newProduct "old product" "new product"

This would read the file named 'oldproduct.svndump' and write the file 'newproduct.svndump' in the current directory. It would search for occurrences of 'OldProduct', 'oldProduct' and 'old product'. They would be replaced by 'NewProduct', 'newProduct' and 'new product' respectively.

Download

co.codewizards.svndumptransformer-1.0.jar (2015-09-26)

...or simply clone this repository and compile it yourself ;-)

Complete workflow

First, you have to generate an SVN dump using the following command:

svnadmin dump /path/to/myrepository > /tmp/myrepository.svndump

You can then process the generated file with this tool:

java -jar co.codewizards.svndumptransformer-1.0.jar /tmp/myrepository.svndump /tmp/newrepo.svndump AAA BBB aaa bbb

... and finally, you create a new repository:

svnadmin create /path/to/newrepo

... and import the transformed SVN dump:

svnadmin load /path/to/newrepo < /tmp/newrepo.svndump

svndumptransformer's People

Contributors

nlmarco avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

svndumptransformer's Issues

Propblems with regular expression like strings

I had problems replacing string that looked like regular expressions, e.g. replacing

a+b+c

by

xxxxx

does not work, because in co.codewizards.svndumptransformer/src/main/java/co/codewizards, line 230

if (string.contains(me.getKey()))

me.getKey() is used as search string, whereas in line 231

string = string.replaceAll(me.getKey(), me.getValue());

it is used as regular expression.

replaceing line 230 by

if (string.split(me.getKey()).length > 0)

did work for me.

If Regular expressions should be disallowed in the replacement,

import java.util.regex.Pattern;

should be added and line 231 should be rewritten

string = string.replaceAll(Pattern.quote(me.getKey()), me.getValue());

Exception with text/plain

Exception in thread "main" java.io.IOException: Unexpected mime-type: text/plain
at co.codewizards.svndumptransformer.SvnDumpTransformer.transformTextContent(SvnDumpTransformer.java:218)
at co.codewizards.svndumptransformer.SvnDumpTransformer.transform(SvnDumpTransformer.java:137)
at co.codewizards.svndumptransformer.SvnDumpTransformer.main(SvnDumpTransformer.java:67)

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.