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.
no subject
Date: 2007-09-16 12:49 pm (UTC)You should be able to find added/removed files by using either svn diff or svn status (or whatever it's called - I haven't used svn that much yet)
no subject
Date: 2007-09-16 01:14 pm (UTC)Doing some searches I found that folks have been asking for the exact same feature as I just did, since 2002, and its still not in there yet...
no subject
Date: 2007-09-16 09:02 pm (UTC)Problem is deletion though... Can't know which ones have been deleted.
no subject
Date: 2007-09-16 11:40 pm (UTC)It is definitely still a pain. I'm a bit surprised nobody's hacked that up yet. One strategy might be to hack together the worst possible implementation of something barely resembling this, and guilt other people into fixing it instead of outright rejecting it :)
no subject
Date: 2007-09-16 03:39 pm (UTC)The bit about searching for new or deleted files can't be too hard to script, though, can it?
no subject
Date: 2007-09-17 04:45 pm (UTC)