Fighting with Subversion.
Sep. 16th, 2007 07:08 amI've just spent the last 3 hours fighting with subversion, and I still haven't managed to do what I was trying. You see, by far the most common use-case I've ever had for Subversion is one that they don't cover at all in their documentation, and seem to think is non-existent, and that is the migration from some ad-hoc version control system.
For example, just now I came across some old archives of snapshots of a project. They were all named things like 'foo-project-<DATESTAMP>.zip' and had been made just by copying and zipping the project filetree in its current state. What I need is some way to present successive snapshots to subversion in such a way that:
For example, just now I came across some old archives of snapshots of a project. They were all named things like 'foo-project-<DATESTAMP>.zip' and had been made just by copying and zipping the project filetree in its current state. What I need is some way to present successive snapshots to subversion in such a way that:
- newly appearing files are automatically added to the archive.
- vanishing files are automatically deleted
#!/bin/bash for zip in foo-project-*.zip; do unzip -d foo $zip svn import --update -m "automated import" foo file:///path/foo/trunk rm -rf foo-project doneOr something along those lines. Instead, you have to:
- import the first snapshot to make the repository.
- checkout a copy of the repository
- unzip the next snapshot
- diff the working copy against the snapshot
- manually mark and delete any files that have vanished.
- copy the snapshot over the current copy.
- commit this new version
- delete the snapshot, and goto step 2.