[p4] Perforce triggers

Weintraub, David david.weintraub at bofasecurities.com
Wed Jul 12 07:41:52 PDT 2006

I believe that these are both Perforce "bugs".

Remember that submits in Perforce are atomic operations, and that
Perforce has to make sure that files are not changed while a submit is
in process. Therefore, files are marked as "read-only". If the submit
operation succeeds, files will still be marked "read-only" until you
edit them.

I've seen this before, and it seems that Perforce forgets to backout the
"read-only" setting on a failed submit (since the files are still opened
for edit, they should be writable).

I know that files are locked while a submit is in progress, and maybe,
like the "read-only" setting, Perforce simply doesn't back this out on
failed submits. Then again, maybe this is really a feature. Most of the
time, a failure in the submit process is a minor bug that can be quickly
corrected. Keeping the files locked allows you to quickly fix the
problem before starting the commit again. That way, you can resubmit
where you left off instead of discovering that someone changed a file
while you were fixing the submit problem, and now have to resolve the

As far as I know, submits are serialized, so only one submit goes on at
a time. This means that locking files on submit isn't really necessary
since no one else can submit changes into the source archive while
you're in the middle of a submit command anyway.

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Knight, Steve
Sent: Wednesday, July 12, 2006 9:26 AM
To: perforce-user at perforce.com
Subject: [p4] Perforce triggers


Much to the annoyance of some of the developers at our organisation I've
added certain code format checks into a Perforce change-content trigger.
This seems to work very well.

However, one of the side affects is that should the submission fail it
will leave the file locked and read only on the client.     So the file
then has to be at the very least chmod'd and possibly unlocked too.
Even the people who support the spirit of what I'm trying to do aren't
too keen on this second aspect.

Is there something I'm doing wrong or is it a bug?   (I couldn't find
anything relevant in the Tech Notes ...)



This message may contain confidential, proprietary, or legally
privileged information.  No confidentiality or privilege is waived by
any transmission to an unintended recipient.  If you are not an intended
recipient, please notify the sender and delete this message immediately.
Any views expressed in this message are those of the sender, not those
of KBC Financial Products or any affiliate thereof. 

This message does not create any obligation, contractual or otherwise,
on the part of any such entity.  It is not an offer (or solicitation of
an offer) of, or a recommendation to buy or sell, any financial product.
Any prices or other values included in this message are indicative only,
and do not necessarily represent current market prices, the prices at
which any KBC entity would enter into a transaction or the prices at
which similar transactions may be carried on that entity's own books.
The information contained in this message is provided "as is", without
representations or warranties, express or implied, of any kind.  Past
performance is not indicative of future returns.  

perforce-user mailing list  -  perforce-user at perforce.com

More information about the perforce-user mailing list