[p4] Looking for comment on trigger for case validation

Alen Ladavac alenl-ml at croteam.com
Wed Mar 25 00:24:58 PDT 2009


I've been using this script for a while and it seems to work very
well. However, I've noticed one missing detail.

It is impossible to rename files/dirs to change their case once this
trigger is in place. (E.g. If a file was supposed to be camelcase, but
the original author accidentally submits it in lowercase, the triggers
prevents submitting a rename to fix that. )

I think the correct approach to this would be to check if the same
changelist includes enough deletes to make the adds valid. (I.e. it
deletes all files/dirs that generate the case conflicts.)

Before I indulge into making these corrections, I thought to ask if
someone has possibly already done something similar?

Thanks,
Alen

Bruce wrote at 1/10/2006:

> Hello all,

> Having a need for a case validation trigger I went looking at what is
> available and did not quite find what I was hoping for. So... I tried
> rolling my own. 

> I have tried to make the script quick, to this end it will only validate
> an individual path element and file name once. It will stop validating
> path elements if it finds the that parent does not exist in the archive.

> I have written the script to expect that the P4USER, P4PASSWD, and
> P4CLIENT settings already exist. I suggest using a P4CONFIG file, but
> you could easily code it into the script.

> The script is available at 
> <http://public.perforce.com:8080/@md=d&cd=//guest/bruce_mcpeek/&ra=s&c=f
> vY@//guest/bruce_mcpeek/p4-triggers/?ac=83>

> I have included a "debug" version that basically adds some counters for
> displaying metrics. My server is Linux and runs there. I have had it run
> under Windows but not with a Windows based server.

> Please be kind, this is my first real attempt at such a thing.


> Best regards,

> Bruce McPeek
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user



-- 
Alen



More information about the perforce-user mailing list