[p4] Adding new file to changelist file set using a trigger?
jeff grant
t.swat.consulting at gmail.com
Wed Jan 17 08:33:20 PST 2007
Hello everyone-
I am working on some integration issues with ANT and our deployment system
(Sun System Provisioning Service) and have come up with the need to
determine the perforce changelist/revision number of the currently sync'd
workspace, WITHOUT having access to the P4 client or server.
The way I see it, I need some sort of file that is automatically maintained
by Perforce that only contains a line similar to:
perforce.changelist=XXXX
where XXXX is the changelist/revision number of the last sync that was done.
I've figured out that I need to use either a change-submit or change-content
trigger, but the trick is that I want this trigger to add a file (the one
containing the above information) to the newly created changelist file set,
as I don't see this as being a file that I'd want anyone modifying. Even if
they did, it'd get overwritten by the trigger.
The process would be something like this:
user submits file changes
trigger is fired before changelist is committed/saved
trigger knows the new changelist number via the %change% variable
(arbitrarily = 1234 for this example)
trigger creates new version of "p4_rev.txt" with contents of "
perforce.changelist=1234"
trigger includes new p4_rev.txt as part of the about-to-be-subitted
changelist file set
changelist files are committed, including new p4_rev.txt
--- after some period of time ---
someone/something performs a sync, gets changed files, including new version
of p4_rev.txt, which SHOULD contain the same value as #HAVE on that client,
in this case 1234.
Anyone know how to do this? The only way I've figured out how to do this is
to have it create a new changelist right after the check-in/submission,
meaning your change log would look like this:
"real" files included in # 1234
pr_rev.txt (containing 1235) in #1235
"real" files included in # 1236
pr_rev.txt (containing 1237) in #1237
Less than ideal, IMO.
Anyone have any thoughts/ideas? I haven't seen any examples on how to do
that in any of the Perforce documentation or via any Googling, etc.
Thanks...
...jeff
More information about the perforce-user
mailing list