Identify file paths of changes within IOperationParticipant
Hi,
I am writing an IOperationParticipant for the com.ibm.team.scm.service.changehistory.modification Operation (Deliver (phase 2)). As part of the functionality I need to be able to determine the affected resources path during the following changes:
I am having trouble identifying how I can get the following information however (running in the Server as an IOperationParticipant): 2. File addition - how to find out what the path will be 4. File reparenting - how to find out what the path was (both the afterState and beforeState seem to yield the new path) Any help much appreciated, Dan |
Accepted answer
Ensure you are looking up the path in the context that you care about.
- Try using the source (ie. repository workspace) to look up the path in the case of the file addition. - Try using the target (ie. stream) to look up the path in the case of reparenting. You'll want to check your service configuration provider that you give to the the #configurationLocateAncestors call. Ensure you're using the provider for the correct context (source or target). Dan Pollitt selected this answer as the correct answer
Comments Thanks for that, so far I have just been using the target stream. How would I access the other contexts you mention? You asked about getting the other contexts. I assume you're using the deliver operation data. AdvisableOperation#getOperationData returns an object. For a deliver operation, it is DeliverOperationData that can give you the source and target. If you're not already using this, this is the way to get the source and target for the deliver operation as well as other data such as the change sets. 1
Dan Pollitt
commented Mar 11 '14, 8:34 p.m.
Hi Tim,
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.