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

Re: Inverse of svn export (only create or update .svn / _svn directories)

From: Matthew Hannigan <mlh_at_zip.com.au>
Date: 2007-03-05 21:55:09 CET

On Mon, Mar 05, 2007 at 09:51:32AM -0800, Blair Zajac wrote:
> Matthew Hannigan wrote:
> >On Sat, Mar 03, 2007 at 04:23:38PM +1100, Matthew Hannigan wrote:
> >>Here you go .. (attached)
> >>
> >>It doesn't do _svn directories, but then
> >>it's only for Unix anyway .. or cygwin I guess.
> >>
> >>Bug fixes gratefully accepted.
> >
> >Heh, I can see an improvement to be made already;
> >use the 0 eol features of gnu's find and cpio:
> >
> >i.e.
> >do
> > find . -print0 | grep '/\.svn' | cpio -pdm0 "$checkout"
> >instead of
> > find . -print | grep '/\.svn' | cpio -pdm "$checkout"
> You can't do a grep when you use -print0, since the output from print0
> is at minimum a single line, s grep will not remove what you don't need.

Good point, it looks like there was a good reason to use the non-0 form!

> You need something like this
> find . -name .svn -print0 | cpio -pdm0 "$checkout"

That won't do it; cpio will only copy the .svn dir
and not their contents.

So just use the non-0 form; .svn dirs don't have funky
chars in the names anyway.

You might be able to improve the grep to prevent matching
say, .svnblahblah

        grep '/\.svn[/$]'

ensures the .svn is followed by end of line or slash.

There's also rsync with it's --include option, but where
do you stop? I didn't want to require rsync, even though
it's almost everywhere.


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Mar 5 22:06:00 2007

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.