On Oct 21, 2008, at 13:57, Ruslan Sivak wrote:
> Ryan Schmidt wrote:
>
>> On Oct 21, 2008, at 11:27, Ruslan Sivak wrote:
>>
>>>>> I guess this goes back to my issue of committing the files.
>>>>> The changes happen directly on the file system, and nightly I
>>>>> issue an svn commit as part of a batch process. The problem,
>>>>> however, is that it doesn't commit deletiions. Is there still
>>>>> no way to pass a parameter to the svn executable to tell it to
>>>>> commit the deletions as well?
>>>>
>>>> Run "svn rm" for each file you want to delete. Then "svn ci".
>>>
>>> This will add a lot of complexity to my application. It will
>>> also add extra revisions which we don't necessarily need. For
>>> example, someone uploads a photo for the photo gallery. I would
>>> then resize the photo, and all the original and all the new sizes
>>> into the repository. The person then decides to replace that
>>> photo with a different one. I now delete the old photos, commit,
>>> upload the new photo, resize, add the files, commit again.
>>> Not only is this a lot more complicated, but it wastes repository
>>> space.
>>
>> Extra revisions shouldn't be a problem at all, though I don't see
>> why there would be extra revisions. You said you issue a nightly
>> commit as part of a batch process. Presumably before you commit,
>> you run "svn add" on new files you discover. So, just also run
>> "svn rm" on the files that need to be marked as deleted in the
>> repository, and then run your single "svn commit".
>>
>> I also don't understand your assertion of wasting repository
>> space. Anything you add to the repository takes up space in the
>> repository. If you delete it with "svn rm", that space is not
>> reclaimed; it's still used, and the file is still there in the
>> repository history. This is how Subversion is designed to work. If
>> you don't want deleted files taking up space, then you may need to
>> look into a tool other than Subversion.
>
> The problem here is that my script is very simple.
>
> svn add .
That only adds the directory, which is presumably already under
version control. Maybe you mean "svn add *" which would add all files
in the directory? Or do you only ever add entire directories worth of
photos, never individual files?
> svn commit .
>
> So in order to delete things, I would need to do somethign like
> svn st
> figure out which files are deleted
> svn rm deleted files
> svn commit
>
> This is a lot more complicated, and currently I don't see a way to
> do it. Tortoise lets you commit deletions easily, but I don't see
> an easy way to script it.
Off the top of my head:
svn st | sed -n 's/^\! //p' | xargs svn rm
That might not be compatible with filenames or paths that have spaces
in them.
It also assumes you have Unix-like utilities like sed and xargs
available to you. If your server runs Windows, you'll have to find
Windows versions of those utilities, or maybe use Cygwin or move to a
Linux server.
> P.S. When I talked about wasting space, I meant doing a commit
> every time there was a change, not a nightly commit.
Each commit should take a fixed amount of space for some
administrative information, plus the space for the changes you're
committing. That fixed amount of space should be small, but if you
have many files (i.e. thousands) in a single directory, it could be
larger than one would like.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-21 22:11:58 CEST