[p4] Script files and versioning

Robert Cowham robert at vizim.com
Wed Nov 5 08:24:23 PST 2008


Depends somewhat on your deployment method.

I tend to do one or more of:

- embedding keywords in particular files ($Id$ or $Change$). I don't always
choose to display this value easily, but it is a backup so I can always dig
it out if trying to make sure someone hasn't been updating things outside
the process.

- having a single file with the above which is included by all the others
(or at least is executed to display the "current version") - this then
becomes the user visible "version"

- having the above single file be manually updated and submitted with a
version number in

- in your packaging/deploy script actually creating such a file with version
info (e.g. with latest changelist on that branch or similar). It is worth
spending time on getting this packaging/deploy correct and fully automated.

It depends on things like how accessible your scripts are, and indeed your
servers - what's the update mechanism, is access to those files controlled?
(Can you avoid anyone updating them except via the official deployment
mechanism)?

How easy to you want it to be able to see things - there are sometimes
issues with exposing too much info to customers (re repository structure). 

Consider your various scenarios and test your solutions against them.

Some thoughts
Robert

> -----Original Message-----
> From: perforce-user-
 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> Robert Schneider
> Sent: 05 November 2008 09:27
> To: perforce-user at perforce.com
> Subject: [p4] Script files and versioning
> 
> I hope one of you can give me some advise. I still don't know 
> how to do it.
> 
> We have a bundle of developed php files that make up a 
> certain intranet site that gets deployed on our customer 
> servers. Until now there was no version for this php 
> application. We just had the terms 'the old version' or 'the 
> version that is installed on ...'. Awkward, I know.
> 
> Now I'd like to introduce a versioning scheme for the php 
> application. So we can talk about e.g. 'Version 3.2'. But my 
> problem is, that I don't know how to achieve this correctly. 
> At least I know that all files should be seen as one group 
> that get one version.
> 
> Should each php file get a comment with a version? Could I 
> use keyword expansion? If so, which keywords? Should the 
> version be visible in the application, so it is visible in 
> the browser? What could you recommend? How would you do it?
> 
> I have similar issues with some Python script files that 
> build up a server. And also with a SQL script that creates a 
> database. It would be also interesting how to version these 
> items too. Same way or different?
> 
> Thank you,
> Robert



More information about the perforce-user mailing list