[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: File management

From: Ryan Schmidt <subversion-2010a_at_ryandesign.com>
Date: Fri, 22 Jan 2010 01:12:47 -0600

On Jan 22, 2010, at 01:00, Naz wrote:

> I would like to use Subversion as a document management repository. I.e., instead of keeping source code in the repo, I'll keep Word docs, Excel sheets etc. I do understand that I lose diffing and all text file handling functionality, but that's fine, all I need is an easy solution to versioning and incremental backing up.
> The only remaining problem I have in doing this is file management. I can add files into the local directory and then just add the line "svn add --force ." to the my script. However, I need to be able to update deleted files and moved files as well. I.e., if I delete a file from my local dir (other than by using svn del) I need it to be removed from the repo.
> Using svn del every time I want to delete a file is not really practical, as I prefer to do file management using explorer, thunar or the cli, depending on which OS I'm in at the time. I don't want to have to remember to only ever do deletes and moves using the svn client.
> Is there any way that I could script the deletion of files that are in the repo but have been removed from the working directory? I.e., if I delete a file from my local copy, run the equivalent of "svn del" on every missing file before the commit, so that the working dir and the repo stay in sync.

Yes, you probably could. "svn st" should show you files that have been deleted but not marked as deleted (status "!"); you could then "svn rm" them. Or, if your operating system provides the facility to be notified when files are changed / deleted (for example, Mac OS X has Folder Action Scripts), then you could implement a script at that time.

Officially, the recommendation is not to try to detect changes in a working copy, but to use the svn commands directly; see the FAQ:

Received on 2010-01-22 08:13:28 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.