GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Synchronization filter doesn't work as expected


#1

Hello,

when I use the synchronize function with a filter there are still some directories shown, which aren't supposed to be on the list (.svn directory).

Greetings
Martin





#2

See the FAQ: How to filter items by location or sub-folder (also, don't miss the note about filters and synchronize where it says you have to use a location filter).


#3

Hello,

thanks for your reply. I don't understand how the sobfolder clause works. I don't want to see any folders with the name .bzr in it, nor files which are in those folders or subfolders. My result of my search currently looks like the one of the attached picture.
test.7z (399 Bytes)



#4

Off the top of my head, I'm not sure why that search is including the .hg folder, but you cannot use Subfolder clauses when Synchronizing anyway, so you'll need to convert the filter to use Location clauses instead.

(The first two examples in the FAQ use Location clauses.)


#5

It also doesn't work for me when I use the location clause, or am I overlooking something?



#6

The Location clause is applied to the entire path of the folder each file is in.

Since the path won't be .svn .hg or .bzr (it will contain those names but it won't be just those names), filtering like that won't exclude what you want.

Instead, change the location clause to:

*(.svn|.hg|.bzr)(*|)
Use wildcards

(The b[/b] part is explained in the FAQ linked above if you're wondering what it's doing.)

(Note: I switched to wildcards, not regular expressions, as it simplifies things. You can still do ( ) | stuff with wildcards and using them instead of regexs avoids having to escape all the backslashes and dots.)

(BTW: You might want to turn off the wildcards checkboxes on the other lines in your filter, since they are not really using wildcards and it might slow things down a bit.)


#7

Thank you for clarifying things for me. I still have two questions. When I use regular expression and wildcards I get a different search result although I expected the numbers to be the same. What am I missing here? The second question is, that when I use wildcards I still have to use a name filter with the name of the directories I don't won't to have in the result list.




#8

The regular expression and the wildcard in your two screenshots do not match the same things. (You forgot to escape the dots in the regular expression.)

Also, they are both using a different format to what I suggested in my previous post and in the FAQ. The way you are doing things, you will exclude folders like "ThisIsNotAn.svnFolder" as well as ".svn". (That's fine if you are certain there won't be any folders like that, of course. It's probably fine in this example, but in general it can lead to problems.)

You have to do that whether you use wildcards or regular expressions.


#9

Hm, shouldn't the version with the regular expression not return more results in my case as the "."-character matches any character?


#10

You are excluding something using the regular expression.

If the expression matches more things then more things will be excluded.

If more things are excluded, fewer things are in the results.

And, indeed, the screenshot using the regular expression has a lower count than the one using the wildcard.


#11

Oh, well I've completely overlooked that... Thanks for your patience and your explanations!


#12

Hm, am I still missing something? I still got some files from ".svn" directories in the synchronization results. Only subdirectories from ".svn" directories are shown. Files in ".svn" are excluded as intended.





#13

I think that may be a bug. It reminds me of this: Synchronization Filter Not Applied to Destination Lister?


#14

Sorry it took so long to answer your last post. Yes I think this is the same problem. Hopefully the problem will be fixed in one of the next versions.