I keep everything in Subversion. Lecture notes, bits of writing, everything. Including bits of miscellaneous code, the prototypes of which sometimes blossom (or metastasize, depending on your point of view) into full-sized projects.
To this end, I have a “miscellaneous code” repo with subdirectories for each new thingy. Most of these are very small, but sometimes they get large or I might want them to become public, in which case I have to turn part of this repo into a whole new repo.
To do this, I need to:
- dump the repository
- filter the repository to include only the bit I want
- change paths
- populate a new repo with the new data
1 2 3 |
svnadmin dump svn/misc_code | svndumpfilter include \ --drop-empty-revs \ --renumber-revs /barry >barry.dump |
1 |
-path: barry/ |
with
1 |
-path: trunk/ |
Now you can create the new repo and load the data into it:
1 2 |
svn create svn/newrepo svn load svn/newrepo < barry.dump |
Also, pretty much none of this will work with binary data because of the hell that is md5 checksums being screwed up. But for text-only repos, it should be fine.