[p4] Propagating Changelists description upon integration

Ildefonzo Arocha ilde.web at gmail.com
Thu Sep 6 01:57:23 PDT 2007


Hi,

I am wondering if anyone knows how to or has a script/trigger that
upon the integration of a changelist into another branch copies the
description of the source changelist into the target changelist, which
can then be shown before changelist submission as the default
changelist description?

My basic requirement is that from p4v we integrate a changelist into
another branch, the description of the source changelist is copied
into a newly created changelist.

I did a script the does the following:
- Accepts a changelist number as parameter
- Retrieves the source changelist description
- Creates a new changelist
- Copies the description of the source changelist into the target changelist
- Performs an integration with the -c <newchange> parameter into the
new changelist

I added this to p4v as a custom application, so now the user can right
click a submitted changelist run the script, no parameters asked.

The problem with this doing this is that:

- To do this correctly, the script will need to handle all possible
parameters (-d -i -f etc), this I find useless as I am basically
replicating functionality that p4v already has, also for each run I
need to prompt the user for parameters that most of the time will be
irrelevant.

- No preview functionality

- The script will always create a new changelist, hence, It is not
possible to integrate two changelists into one:  Perforce will
integrate common files into one changelists and the uncommon files
into another one (which I find correct), example:

User John adds some new functionality and submitts the change.
- Changelist 1:
//depot/foo1.c
//depot/foo2.c
//depot/foo3.c

Later he finds a bug he introduced in foo1.c and that foo4.c needs
also to be changed:

- Changelist 2:
//depot/foo1.c
//depot/foo4.cl

Now he wants to integrate these two into another branch, if he uses
the script above, right-click change 1, right-click change2, the
result will be:

- Changelist 3:
//depot/foo1.c
//depot/foo2.c
//depot/foo3.c

- Changelist 4:
//depot/foo4.c

In the above example, the correct result should be a newly created
changelist 3, with the descriptions of Changelist 1 plus Changelist 2
appended.

Ideas?

Thanks,
Ildefonzo


More information about the perforce-user mailing list