[p4] Adding new file to changelist file set using a trigger?
jeff grant
t.swat.consulting at gmail.com
Wed Jan 17 10:27:20 PST 2007
Which is specifically why I asked if there is a way to include that file in
the current changelist file set.
I think I've got it figured out and just have to test it a bit, using
keyword expansion on special file types.
...jeff
On 1/17/07, Albrecht, Matt <matt.albrecht at zilliant.com> wrote:
>
> Even if you can get the trigger to work well, a problem with this
> technique is that, as soon as you add a new file / updated file into
> Perforce, the current changelist number changes. This may not be a
> problem for you, however, since the only delta would be a single text
> file containing the changelist number.
>
> For an alternative answer, perhaps you could put a "p4" wrapper script
> on the client machines that would generate this file on sync. May not
> be the most optimal way, as it doesn't really work well for tools like
> p4v and p4win.
>
>
>
> > -----Original Message-----
> > From: perforce-user-bounces at perforce.com
> > [mailto:perforce-user-bounces at perforce.com] On Behalf Of jeff grant
> > Sent: Wednesday, January 17, 2007 10:33 AM
> > To: perforce-user at perforce.com
> > Subject: [p4] Adding new file to changelist file set using a trigger?
> >
> > 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
> > _______________________________________________
> > perforce-user mailing list - perforce-user at perforce.com
> > http://maillist.perforce.com/mailman/listinfo/perforce-user
> >
>
More information about the perforce-user
mailing list