Friday, June 13, 2008

Subversion trials and errors

Late yesterday I tried
$ cd htdocs
$ svn import -m "New import" file:///usr/local/svn/newrepos
which then started processing (what exactly was done?) many large files in the htdocs tree which, on reflection, I don't want in the repository (archived Apache access logs(!), movies which are never revised, etc.). The import then choked on a file for which permissions were wrong.

Two questions now:
  1. How to undo all the processing that was done? (Maybe nothing was done since it choked?)
  2. How to do it better next time?
I don't think that the huge files were actually copied to another location on the filesystem, since this shows that the space is unchanged (if they'd all really been copied, Used should have almost doubled):
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 131G 27G 98G 22% /
And it looks like the best way to undo is to use a system (not svn) rmdir. stspiffy says,
you can svn delete directories, but if you want to get rid of the entire repo forever-ever, ... the correct way to delete a repository is actually to delete the directory.
As far as How to do it better next time,
  1. I think www, not htdocs, should be the 'root' of the project (so that libraries and other (admin, etc) servers are included in the same repository)
    [ah but maybe it's better to have separate repositories? probably not, if it makes updates and commits harder. (But it doesn't, right, since these commands don't require the repository url?) So actually, at an extreme, I could have separate repositories (with granular revision numbers) for each directory in htdocs!] Is it reasonable to have one repository for libraries (which hardly ever change) and another for htdocs (which change 1-4 times/year) and another for the clearinghouseAdmin server, etc? 
  2. I could move archived access logs out of this tree. But what to do with other bulky files?
  3. Probably the best thing to do is vi a folder-by-folder svn import script (vi, :r !ls, :%s/^.*$/svn import -m "New Import" & file:///usr/local/svn/newrepos, zap unwanted lines from the file and then run as a script)

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home