[p4] Simple client spec question

Robert Cowham robert at vaccaperna.co.uk
Sun Jul 2 01:41:22 PDT 2006


> On 6/30/06, Steven W. Orr <steveo at syslang.net> wrote:
> > I have the following two lines in my client spec
> >
> >    //depot/NSG/KG-250/jte/main/... 
> //sorr-kg-250-t2/spmfp/jte/main/...
> >    //depot/NSG/KG-250/spmfp/main/... //sorr-kg-250-t2/spmfp/...
> >
> > I found that the spmfp/jte dir never got created. I screwed 
> around and 
> > tried switching the order and that fixed it.
> 
> When you have two lines in a view that map the same location 
> the last one wins.

I would add to this that view specs are read by Perforce left->right AND
right->left. In the original order, the second line overwrites the first
line and thus the first line has no effect. When swapped, the (now) second
line has an effect, but because it maps less stuff, you get the result it
would appear you want.

> The advice I routinely give users about overlapping mappings 
> is "Don't do it."  This is second only to deleting open files 
> as a source of confusion.

I would certainly recommend this to start with, until you get the hang of
client workspace mappings. However, there are times when the behaviour is
useful, as long as you know what you are doing. Imagine you have a product
with 10 sub-components and you have a couple of branches. You can set your
workspace up to try out the combination of one branch plus a specific
component from the other.

//depot/jte/main/... //workspace/...
//depot/jte/some_branch/compA/... //workspace/compA/...

People sometimes find it easier to understand exclude mappings and
requirement for order to be respected.

//depot/jte/main/... //workspace/...
-//depot/jte/main/compA/... //workspace/compA/...

I quite often see this, which works but the exclude mapping isn't necessary:

//depot/jte/main/... //workspace/...
-//depot/jte/main/compA/... //workspace/compA/...
//depot/jte/some_branch/compA/... //workspace/compA/...

As an aside on exclude mappings, the right hand side is important. For
example, if you try this:

//depot/jte/main/... //workspace/...
-//depot/jte/main/compA/... //workspace/...

And sync it you will get no files! This is because the two right hand sides
are the same, and the second line overrides the first.

Does that help?

Robert
P.s. overlay mappings (+) are another level of complication...




More information about the perforce-user mailing list