tags:

views:

141

answers:

4

We use Visual Studio, which generates lots of bin and obj directories. When I use P4V's "Reconcile Offline Work" feature, these appear in the "Local files not in depot" list.

I'd like to exclude them. I found this question, but that talks about files, and when I try what it suggests (adding the following to my workspace view), it doesn't work:

//depot/Foo/... //Client/Foo/...
-//depot/Foo/.../*.user //Client/Foo/.../*.user
-//depot/Foo/.../bin/... //Client/Foo/.../bin/...
-//depot/Foo/.../obj/... //Client/Foo/.../obj/...

It doesn't actually seem to work for files, either: the foo.csproj.user files are still displayed in the list.

Can I exclude directories from P4V? If so, how? What am I doing wrong?

+1  A: 

This is somewhat tricky, because there is no built-in way to exclude a directory from a Perforce command. You can have a look at a short perforce article for this problem.

Thariama
Gah. That's hideous, but might be the best way to do what I want. I'll give it a whirl later.
Roger Lipscombe
indeed it is ugly
Thariama
+1  A: 

The syntax of your exclusion rules is just a little off. What you want is this:

-//depot/Foo.../*.user //Client/Foo.../*.user
-//depot/Foo...bin/... //Client/Foo...bin/...
-//depot/Foo...obj/... //Client/Foo...obj/...

Note the missing slashes after "Foo" and before "bin" and "obj".

raven
That doesn't work for directories; I'm still seeing (e.g.) path\to\bin\Debug\Foo.pdb.It does work for the foo.csproj.user files, though (which it didn't seem to be yesterday) Odd.
Roger Lipscombe
But it does seem to work in the Advanced Reconcile box. What's going on here?
Roger Lipscombe
A: 

I would go ahead with the Reconcile Offline Work and do everything but the submit. Before the submit, do the following:

p4 revert //Client/Foo/.../*.user

p4 revert //Client/Foo/.../bin/...

p4 revert //Client/Foo/.../obj/...

It's not automated, but that's the best I can think of at the moment.

Chance
A: 

This may not be relevant, but if there are spaces in any of your paths you need to ensure you have correctly enclosed them in "" but dont enclose the - inside the quotes.

Toby Allen