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

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

From: Christopher Ness <chris_at_nesser.org>
Date: 2005-06-10 20:03:49 CEST

On Fri, 2005-06-10 at 12:40 -0400, Eric Gorr wrote:
> Proniewski Patrick wrote:
> > On 10 juin 05, at 10:59, Mathieu Betrancourt wrote:
> >
> >> If you add, or delete contents in the document (like pictures), the
> >> application will add, or remove files into the bundle.
> >>
> >> Is there a (simple) way to make svn follow every changes in a folder ?
> >
> >
> > Damn, I haven't seen this one coming. As i see it, you might want to
> > create a wrapper (shell script for example) for svn command, that would
> > check for bundles, and automagically `svn add` or `svn delete` files
> > before commit.

I agree and had to do this myself after applying some ARM patches to a
kernel. Files were removed and added so I needed to tell subversion
what to do. A simple one liner to do just this is like so...

To remove files that went away and are identified by a '!', use:
           svn status | grep ^\! | cut -c8- | xargs svn rm

To add files svn doesn't know about:
           svn status | grep ^\? | cut -c8- | xargs svn add

> Well, it would seem useful for the svn client application to handle this
> itself at some point in the future. Perhaps a property stored with the
> folder containing versioned resources. The property would basically tell
> the svn client that it should check to see if there are any files in the
> folder (or it's subfolders) which aren't versioned and to automatically
> add them if any are found. Of course, one should be allowed to exclude
> files or subfolders based on regular expression patterns from this check.
>
> I have a feeling, considering that Bundles are such a good idea, that
> other OSs will adopt them for documents as well. (Windows has them for
> applications...I suspect bundled documents on Windows will come with
> Longhorn.)

Good luck convincing the Devel's. ;) They don't like to add bloat for
things that can be simply [though that is a relative term] done outside
the program and I agree with that stance.

I hate to say it but most SVN commands that I know do not attempt to do
"auto-magic" things for users. You need to tell subversion exactly what
you want to do.

It isn't too hard to be explicit - see above. You should be able to
write similar scripts in other OS' other than GNU/Linux.

Cheers,
Chris

-- 
Wireless Group,
McMaster University
finger.localdomain
13:47:42 up 3:28, 1 user, load average: 0.00, 0.05, 0.03
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jun 10 20:06:47 2005

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.