swestrup: (Default)
[personal profile] swestrup
I'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:
  • newly appearing files are automatically added to the archive.
  • vanishing files are automatically deleted
Ideally, it should be as easy as doing a series of commands like
#!/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
done
Or something along those lines. Instead, you have to:
  1. import the first snapshot to make the repository.
  2. checkout a copy of the repository
  3. unzip the next snapshot
  4. diff the working copy against the snapshot
  5. manually mark and delete any files that have vanished.
  6. copy the snapshot over the current copy.
  7. commit this new version
  8. delete the snapshot, and goto step 2.
ARGH!!!  There has GOT to be an easier way, I keep telling myself, but I haven't found one.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

January 2017

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 13th, 2026 05:46 pm
Powered by Dreamwidth Studios