It's all about the answers!

Ask a question

Programmatically patch creation


Michele Pegoraro (1.8k14119103) | asked May 19 '10, 7:57 a.m.
Hi,
I'd like to know if is there a way to create a patch programmatically from a change-set using client side java plain API.

Is there someone that have already done this kind of activity? Which class and method could I use?

Thanks,
Michele.

6 answers



permanent link
Michael Valenta (3.7k3) | answered May 19 '10, 10:02 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Michele,

Unfortunately, there is no API for doing this. You may be able to do it
using the command line client using the "scm diff" command.

Michael

mikyjpeg wrote:
Hi,
I'd like to know if is there a way to create a patch programmatically
from a change-set using client side java plain API.

Is there someone that have already done this kind of activity? Which
class and method could I use?

Thanks,
Michele.

permanent link
Michele Pegoraro (1.8k14119103) | answered May 21 '10, 5:19 p.m.
Michael,
thank you for the answer. I'm not really used with this command but I'm making some test. I'm not shure about how to correctly use it for my use-case. What I'm trying to develop is the following scenario:

I have a repository workspace on which I've create a change-set. Then I have deliver my change-set to my target stream.
What I'd like to do is develop something that
-create a new temporary repository workspace from stream
-create a patch using the latest change-set
-apply the patch to my rep.ws
-check-in and delivery the new created change-set
-remove the temporary rep.ws

From diff's command reference it seems that it could be used on single file, not with an entire change-set. Is it true? And if this is not true, I've not understand yet which parameter I've to use as target and previous version in order to create the correct patch.

Any idea would be really appreciate.
Thanks,
Michele.

permanent link
Michael Valenta (3.7k3) | answered May 26 '10, 9:20 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Michele,

I'm not that familiar with the CLI so I don't have much advice to offer
there. However, I think the command for getting a patch from a chaneg
set is 'scm diff changeset <uuid>' where you get the UUID or
alias using one of the CLI status commands.

Michael

mikyjpeg wrote:
Michael,
thank you for the answer. I'm not really used with this command but
I'm making some test. I'm not shure about how to correctly use it for
my use-case. What I'm trying to develop is the following scenario:

I have a repository workspace on which I've create a change-set. Then
I have deliver my change-set to my target stream.
What I'd like to do is develop something that
-create a new temporary repository workspace from stream
-create a patch using the latest change-set
-apply the patch to my rep.ws
-check-in and delivery the new created change-set
-remove the temporary rep.ws

From diff's command reference it seems that it could be used on single
file, not with an entire change-set. Is it true? And if this is not
true, I've not understand yet which parameter I've to use as target
and previous version in order to create the correct patch.

Any idea would be really appreciate.
Thanks,
Michele.

permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 19 '11, 6:13 a.m.
Hi, I'm wondering if there are still no API to do this.
I have find this class on sdk:
com.ibm.team.filesystem.common.internal.patch.CreatePatchUtil
with a createPatch method. But I can't find any classes (either in test jars) where this command is used.
Does anyone have some idea about this?

permanent link
Michael Valenta (3.7k3) | answered Apr 20 '11, 8:53 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
There's still no API. The class you found is involved in patch creation but it is called from one of our UI plug-ins so you would need to get the full RTC Eclipse client to see examples of it's use.

permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 22 '11, 10:18 a.m.
Thanks, I'll take a look on it.

Your answer


Register or to post 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.