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

Re: svndumpfilter does not exclude some files

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 15 Oct 2012 11:30:45 +0200

On Mon, Oct 15, 2012 at 12:56:40PM +0800, Jason Heeris wrote:
> Okay, I managed to cheat a bit, so I'm sharing my workaround here. In
> my includes file, I used the form:
>
> /specs*01234*
>
> ...and for the directories:
>
> /results/RST-0001 (v0.01) #001*
>
> ...and now everything seems to be expunged that should be.
>
> I have no idea why the original form doesn't work, maybe it's the "["
> characters or somesuch. Obviously you need to be a bit careful that
> your patterns aren't too general; in my case those five-digit numbers
> are a unique enough pattern to work for me.

The square brackets are wildcard syntax saying "match any of the characters
listed within the brackets". This is part of the syntax of the fnmatch()
standard C function, see:
http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13_01

The pattern you originally tried to use:

   /specs/[01234]

would match any of the following paths:

   /specs/0
   /specs/1
   /specs/2
   /specs/3
   /specs/4

But not this path, assuming '[01234]' is a literal part of the filename:

  /specs/[01234] product x spec.pdf

The pattern you ended up using is a better way of matching those paths:

  /specs*01234*

You should be able to quote the square brackets with a backslash to prevent
them from causing wildcard matching. For instance, the following should
match '/specs/[01234] product x spec.pdf':

   /specs/\[01234\]*pdf
Received on 2012-10-15 11:31:35 CEST

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.