[p4] Implement a "p4 checkout"
Michael Graff
michael.graff at diversifiedsoftware.com
Wed Jan 5 14:32:21 PST 2000
Our folks are accustomed to serial checkouts where the first person to
check out the file has a lock on it. They can't check out a file if
somebody already has it locked. I'd like to make Perforce work this way by
default.
I see the SCC plugin has a "lock" option that works this way. If it can't
get a lock, it gives a warning and reverts the file. Here's an example:
Checking out and locking files.
//depot/Desktop/AJMGR.CPP#5 - opened for edit
//depot/Desktop/AJMGR.CPP - locked by THEOTHERGUY at theother
//depot/Desktop/AJMGR.CPP - already locked by THEOTHERGUY at theother
The following files were not opened because they could not be locked:
AJMGR.CPP
//depot/Desktop/AJMGR.CPP#5 - was edit, reverted
I'm looking for a similar feature in P4WIN, but I didn't find it. Edit and
lock seem to require separate actions. Did I miss an option somewhere?
I'd also like to do something similar at the command line. A "p4 checkout"
or "p4 editlock" command would be the most obvious, but if I could easily
duplicate the SCC "could not be locked" function with a wrapper, that would
be okay too. I notice that if I do a "p4 lock" I always get a zero return
code whether the lock happened or not.
So, how does the SCC get the list of files that couldn't be locked? Does
it just parse the output of the lock command?
More information about the perforce-user
mailing list