View previous topic :: View next topic
|
Author |
Message |
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
I want to develop a tool using rexx which will compare the Test version with Production version of Same program and merge the code automatically in the test program if any unmatch found. can anyone give some idea on this ? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Why that?
Assuming that the production program is the original, and the test program is the modified version, "merging" as you explain it merely consist in restoring the original.
For this, you can simply do "DEL ALL NX" followed by "COPY prod-member"
Alternatively, you can edit the test version, do a "COMPARE prod-member X" and look at the differences.
You can then easily delete added lines or restore deleted ones. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
why reinvent the wheel ...
read about ALL the capabilities of ISPF SUPERC |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Ok for SUPERC, but it depends of the ambition of the project
For source code ( in a language or another ) , for me:
Code: |
if zonea = zoneb then |
equals to
Code: |
if zonea = zoneb then |
or even to
Code: |
if zonea = zoneb ,
then |
|
|
Back to top |
|
|
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
Actually in our case, when someone changes moved to production, its the responsibility of developer to merge his changes if the same program available in other test environment's by other users. so currently we are manually merging the code to keep sync in Production.
will it be possible to develop a Rexx toll , which will run in the Test program to compare with production program and merge the changes in Test Program automatically .. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
small remark : not a Rexx toll but a Rexx tool |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
The ISPF Edit COMPARE command is ideal for this. It shows you the code differences as labels and temporary lines. To incorporate a line from the production code, you can use the MD (make data) line command on the temporary line.
COMPARE makes code retrofits fun and easy!
Ok, I am exaggerating about the 'fun' part. But it does make it easy.
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
I do not think you explained the scenario well... I imagine it is a case of two different change streams: the development of new line items and service to existing production code. You do not want the defect resolved in release 1 to appear again in release 2.
It is not a case of comparing two files... you want to compare 1) the original source with 2) the service to see what was changed, then you want to determine which of those changes get promoted to 3) the development library. That is three files.
There will be some lines added, some deleted, others reformatted. I do not think you want to 'automatic merge', but rather, you want the developer to merge the code. If you have more than one person involved, you may want to have code reviews along the way. That is where the 'fun' part is.
My experience is that you want to promote the service changes to development soon after they are promoted to production. Otherwise you have the risk of too many service changes at the same time, which makes it hard to do. And it might invalidate your unit testing. And also you have the 'what the heck was I trying to do?' factor... you tend to forget the purpose of some things unless it is fresh in your mind. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
janmejay wrote: |
Actually in our case, when someone changes moved to production, its the responsibility of developer to merge his changes if the same program available in other test environment's by other users. so currently we are manually merging the code to keep sync in Production. |
OK, you are talking about Parallel Development...
That is a different story, and a compare is just not enough...
I would recommend to forget about a "tool" and to start thinking about a "product".
Basics are:
You must have a Baseline: the same production source that is being modified by two different programmers.
When one of the programmers moves his program to prod, you have to build a Delta file (between the baseline and modif #1).
And when the second programmer moves his program, you must apply the Delta file to the program. |
|
Back to top |
|
|
|