Hi All,
I've been playing in a couple of areas with regards to Osmosis version
control.
- I'm pondering a move to GIT. Primarily because it gives people a
better opportunity to experiment with the codebase. Secondly because I am
experimenting with GIT anyway and wanted a real-world task to work with.
- The svn history is disjointed due to the early history being hosted on
my server, and subsequent history being on the osm svn server. In addition
there have been some renames and re-organisation that are confusing and
break potential migrations to other tools (ie. GIT).
I decided I'd try to fix the SVN history and produce a single repo with
complete history. What started out as a simple shell script with some grep
and sed statements quickly got out of hand and became a full-blown
java-based SVN dump file re-writer that looks quite a lot like Osmosis
itself. Perhaps I should have written it as an Osmosis plugin :-) Anyway,
it does the following major operations.
- Creates a new empty repo with standard trunk/tags/branches structure at
the root.
- Extracts history from http://www.bretth.com/repos/main from revision
417-471 which was the initial period of Osmosis when it was called
conduit.
- Replaces the conduit path with trunk.
- Removes the initial creation of conduit directory which isn't
necessary as data will be imported into existing trunk.
- Renumbers the revisions from 1 upwards.
- Skips revision 472 which was a rename from conduit to osmosis. We
don't need this because the project name isn't reflected in the new repo,
the project is stored in the root.
- Extracts history from revision 473-474 which are the only two revisions
with code stored in the root of the osmosis project.
- Replaces the osmosis path with trunk.
- Renumbers the revisions.
- Skips revision 475 which was a re-organisation into a
trunk/tags/branches structure. This is already done in the new repository.
- Extracts all remaining revisions in my repository from 475-HEAD.
- Removes the osmosis prefix on paths.
- Renumbers the revisions.
- Skips 4742 because that's the original import which is already done
in the new repo.
- Extracts history from
http://svn.openstreetmap.org/applications/utils/osmosis from 4743-12410.
- Replaces the applications/utils/osmosis path with trunk.
- Renumbers the revisions.
- Skips 12411 which was a re-organisation into a trunk/tags/branches
structure.
- Extracts remaining history from 12412-HEAD.
- Replaces a copyfrom path for creation of 0.28 and 0.29 tags which
refer to revisions prior to the repo re-structure and thus have incorrect
path structures in the dump file.
- Removes the applications/utils/osmosis prefix on paths.
- Renumbers the revisions.
It seems to have all worked well. It provides a single repo with full
history from day 1, gives a consistent directory layout for the entire
history, and includes all tags that were ever created. I got part way there
with shell scripts, but the real trick was the revision renumbering which
had to be done because there are numerous occasions where revisions copy
files from significantly older revisions where the main svn repo moved on
between me copying a latest version file and actually doing a commit.
Renumbering required knowledge of entire history and called for a better
language. One thing I haven't fixed is the svn:mergeinfo tags (it's hard),
so I'll probably remove them completely to avoid any confusion.
If you want to try it out for yourself, the migration app is here:
https://www.bretth.com/repos/main/osmosis-svn-to-git
If you load it up in Eclipse, you can simply run the DumpFileMigrator
class. From a command line you'd need to compile the app and run it with
the shell scripts in your working directory. Note that it will take a
*very* long time the first time you run it because it generates a complete
snapshot of the main osm repository locally using svnsync. If you already
have a replica you can copy it in because it continues to update the one it
has each time you run it.
Any thoughts re a possible GIT move?
Brett
___
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/osmosis-dev