[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to automatically update files on alioth from svn



On Tue, Nov 29, 2005 at 10:30:04PM +0100, Yann Dirson wrote:
> I have written a small post-commit hook for a somewhat different usage 
> (the original problem was versionning the hooks themselves).

I've been doing this for quite a while with a variety of SVN repos, with 
very different users and content. Here are a few things I've run into:

- Ensure the correct locale setting is used, otherwise you'll run into 
trouble with non-ASCII filenames. For example, do "export LANG=en_US" if 
en_US defines the correct character set to use (UTF-8, ISO-8859-1, 
whatever...) For optimal results, svnserve should run with the same setting 
as the checkout script. ;-)

- Use the --non-interactive switch for "svn up".

- Use "svn cleanup" if there is trouble during the "svn up". A situation 
where this is necessary Should Not Happen (tm), but it surely has for me. 
:-/

- Do a fresh checkout if the destination dir does not contain a .svn 
subdirectory. (Of course you could do this manually, but with lots of repos 
it's very nice...)

- Consider putting a line "use-commit-times = yes" into the 
~/.subversion/config of the user that does the "svn up". That way, 
checked-out files' timestamps will be those of their last change, not the 
time of the checkout. I like to use this for websites maintained in SVN - 
it allows you e.g. to create appropriate "page last changed on .." 
messages.

BTW, it's not necessary to add locking to the script, AFAIK runs of the 
postcommit script will be serialized by SVN (at least for my libdb repos, 
dunno about FSFS!).

Cheers,

  Richard

-- 
  __   _
  |_) /|  Richard Atterer     |  GnuPG key:
  | \/¯|  http://atterer.net  |  0x888354F7
  ¯ '` ¯



Reply to: