portable perspectives

a blog about programming, life, universe and everything

Using darcs with FTP and without SSH

darcs is my favourite Version Control System. I'm not chris and I have not tried a lot of them, but I just love darcs' cherry picking so everything that misses that is out of my list. Maybe monotone or subversion 1.5 would be interesting.

Anyway, my only issue with darcs is that it does not allow pushing changes to a dumb repository, where dumb means ftp.

Since I don't have ssh access on all my hostings I found the solution in sitecopy which is a nifty utility to keep a remote directory in sync with a local one by doing incremental uploads.

To use this simply install sitecopy (which is probably avilable through your linux/bsd flavour package manager) and create a file ~/.sitecopyrc with a content like this:

site myproject
  server  ftp.myserver.com
  remote  /www/darcs.myserver.com/myproject
  local   /path/to/local/repository
  username  joe
  password  123

and to create a directory ~/.sitecopy. The permission mask for the dir must be 0700 and for the rc file it must be 0600, otherwise sitecopy will complain about insecure files.

At this point you just need to init the remote repository by doing sitecopy --init myproject. It may take some time because the first time you'll be uploading all the old patches in the _darcs/ directory, but the next time you will do this, using sitecopy --update myproject it will be quite fast.

Obviously this approach works nicely only in a single-user environment, because if multiple users share the remote directory there will be inconsistencies, but it is useful to keep your copy of a projects' repository where you can have your patches and where you can point people that want them.

AddThis Social Bookmark Button

Sorry, comments are closed for this article.