Question

I am writing a wrapper script where I will be doing a mass integration to change the branching structure. For now we have a structure like this:

//depot/product/component-1/...
//depot/product/component-2/...
...
//depot/product/component-n/...

and we are moving to

//depot/product/release/component-1/...
//depot/product/release/component-2/...
...
//depot/product/release/component-n/...

I have written a wrapper script for doing a mass integration where every branch move is captured as a part of individual changelist. Like changelist 101 will have integ for component-1, changelist 102 will have for component-2 and so on. And at the end, it will submit all the changes. This is to narrow the submissions at component level.

My fear is if something bad happens in between and my script fails to submit or due to unforeseen reasons, integrations are in an intermediate state and I have to revert back everything to a state prior to running this script. How can I do that ? Is there a mechanism where I can persist the data before submitting somehow into perforce itself so that i can fall back to it?

When I say data, I mean output of

p4 files //depot/product/component-n/...@LabelTobeUsedForInteg 

The constraints I have is that this script will be executed by multiple people doing their own set of integrations which is why I cant just dump the information in a text file locally. I need a solution where people having access only to perforce can get this persisted information in case they have to fall back and revert the submissions. Storing this information in DB is also out of question. :(

Is there a way to achieve this ? Thanks in advance. Really appreciate your help on this.

Was it helpful?

Solution

If you want all the integrations to happen or none, then this is what atomic changelists are for. Put all your integrations in one changelist and either it'll all get submitted or none of it will.

If you do want to do them separately, you shouldn't need to persist the output of the p4 files command. The label will still be on the old revisions after the integration so the p4 files command should still produce the same output.

If you really do need to persist the output, you could just check it into Perforce. Make some area like //depot/integration-records and check each file in to e.g. //depot/integration-records/component-n.txt as it is produced. You can put the addition of the file on the changelist that integrates component-n so that the presence or absence of the file would indicate whether the integration has been done or not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top