[p4] Question about locking branches

Andy Nguyen anguyen at oblix.com
Tue Mar 15 13:50:50 PST 2005


What would be a proper way to lock a subdirectory in Perforce?

For example:

The current branch is opened to every one:


And I would like to lock just one sub directory below it, saying
//depot/projectA/module1/... to prevent any check-in 

So in my "p4 protect", I would have

Write group dev * //depot/projectA/...
Write group dev * -//depot/projectA/module1/...
Write user jane * //depot/projectA/module1/...

No one can access to //depot/projectA/module1/...  then can't even sync
to it except for jane

But I would like everyone to access //depot/projectA/module1/... ,'open'
access only.  And jane will have full access to it.

I tried "open" for group dev, but it still doesn't work.  Any idea, p4
lock won't work, because jane needs to submit her change.

Write group dev * //depot/projectA/...
open group dev * //depot/projectA/module1/...
Write user jane * //depot/projectA/module1/...


-----Original Message-----
From: perforce-user-admin at perforce.com
[mailto:perforce-user-admin at perforce.com] On Behalf Of Marion, Patrick
Sent: Tuesday, October 05, 2004 4:17 PM
To: 'Jeff A. Bowles'; Marion, Patrick
Cc: 'perforce-user at perforce.com'
Subject: RE: [p4] Question about locking branches

Indeed you are correct!  There is a subdirectory down the tree that has
same name as "child".  Thanks for the great tip.

May be you can help me a bit further.  I know for sure that there is
one directory level between //depot and the branch name
(//depot/<product>/<branch>/...).  What I am trying to do with
"//depot/.../<branch>/..." is to have only one line in "p4 protect" to
off a branch.  I tried "-//depot/*/<branch>/..." but perforce complained
about syntax.  Is there a syntax I could use to express this: "any first
level directory after //depot followed by <branch>?

Thanks again for your help. It was great.


-----Original Message-----
From: Jeff A. Bowles [mailto:mrbowles at mac.com]
Sent: Tuesday, October 05, 2004 3:24 PM
To: Marion, Patrick
Subject: Re: [p4] Question about locking branches

I think that your wild-card in the 'take away the permissions' line
is applying to more files than you think.

"p4 files //depot/.../child/..." (or whatever is really in that field)
will tell you what files it'll apply to, at least of files that 

The suspicious part is that some of your protection line wildcards
are "..." at the END of an expression, some are unanchored and
could apply to all of your existing codelines. The unanchored wildcard
in that last line is very curious.

	-Jeff Bowles
	Perforce Consulting Partner

On Oct 5, 2004, at 3:10 PM, Marion, Patrick wrote:

> Situation:
> we have a main branch and a child branch off main.
> I just merged the child branch up to main.  I want to lock the child 
> branch
> so I have the following lines in "p4 protect" in that order:
> write group dev * //depot/<product1>/...
> write group dev * //depot/<product2>/...
> write group dev * -//depot/.../child/...
> Now someone wants to change some of the merged file in main, and 
> submit the
> changes.  No can do!  "cannot lock file..." message!
> If someone edit and submit a file in main that was not part of the 
> merge: no
> problem!
> So my stopgap solution was to open up the child branch again (removing

> the
> "write group dev * -//depot/.../child/..." line from "p4 protect") 
> which
> allows developers to edit and submit files that were merged from the 
> child
> branch.
> This doesn't seem to be the right behavior.  What is it I am doing 
> wrong?
> Thanks for the help.
> P
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
perforce-user mailing list  -  perforce-user at perforce.com

More information about the perforce-user mailing list