Code Monkey home page Code Monkey logo

svn-go's Introduction

Svn Repository Retrofitter

svn-go compromises a small golang library for working with Subversion repository dumps, and a tool based on the library designed to clean up SVN history:

  • removing unwanted properties,
  • perform string replacements of file/path names,
  • remove unwanted paths,
  • retrofit branch changes,

Everything is configured via either command line arguments or a simple rules.yml file.

Sample invocations:

# Unix shell
$ go run . -read /my/repos/subversion.dump -pathinfo

Attempts to load the dump and then displays all the created paths.

# Powershell, any platform

PS> go run . -read svn.*.dump -rules rules.yml -outdir /tmp -verbose

Loads all the files matching "svn.`*.dump" in the current directory with verbose output, applies any changes from rules.yml, and then recreates each file in the output path, /tmp.

go run . -read svn.*.dump -outfile combined.dump

Loads all of the input .dump files and creates a single dump file containing all of them.

Retrofitting

This tool was primarily written to retroactively apply the structure our repository ended up with back to the beginning of it's history.

Imagine that up until r1000 you had a single project layout:

/Trunk
/Branches
/Tags

but you changed this to allow multiple projects.

r1000 /Trunk -> /Project1/Trunk
r1003 /Branches -> /Project1/Branches
      /Tags -> /Project1/Tags

Any path specified in the "retrofit:" list in the yml will be sought out and then actively pushed back to where the first thing branched/copied into it was actually created.

r5: /Trunk created r10: /Trunk/Source/main.cpp created r999: /Project1 created r1000: /Trunk/Source moved to /Project1/Trunk/Source r1010: /Trunk deleted

Running the tool with a yaml like:

retrofit-paths:
 - Project1   # no leading slash

retrfit-props:
 - svn:ignore
 - svn:mergeinfo

This will move the creation of Project1 and Project1/Source back to the creation of the original Trunk directory, and it will rewrite paths from r10 thru r1010 where the original /Trunk was deleted, including branch references.

It will also do a similar search/replace across the svn:ignore and svn:mergeinfo properties.

The net result is that the generated dumps will reconstruct the repository as though you had started with /Project1/Trunk in the first place.

svn-go's People

Watchers

Oliver Smith 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.