Forum Moderators: coopster & phranque

Message Too Old, No Replies

Merging 2 branches of source code

         

ShawnR

3:47 am on May 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi All

Can anyone suggest how I can merge 2 sets of changes to a suite of website files. i.e. Imagine some open source web services application at version 1. Then a company takes the open source code and customises it to produce version1-customised. In parrallel, the open source community takes version1 (not version1-customised) and upgrades it, to produce version2. How can I produce version2-customised, without manually looking through the diff of version1 & version2 and manually applying the changes?

Thanks
Shawn

Apologies in advance if I have posted to the wrong forum... I imagine that the solution will probably be a perl script, although perhaps other solutions are possible, such as existing packages, or shell scrips

jatar_k

3:49 am on May 30, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



sounds like a CVS nightmare(not even sure if you use CVS, sounds like it though). I had a similar problem recently and when we merged it there were a million conflicts. Ended up doing it manually.

ShawnR

3:56 am on May 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the quick response, Jatar. Yes, it is a CVS nightmare :(

>>>"...Ended up doing it manually..."
Ouch, that is what I was hoping to avoid.

jatar_k

4:09 am on May 30, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Really depends on how far the code has changed away from it's other incarnation. Doing a diff and then working through the conflicts is the only real way I see, depending on how bad/many they are.

ShawnR

1:24 pm on Jun 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi All

Just in case anyone has a similar problem in future, I thought I'd post back...

I landed up doing effectively what Jatar suggested. i.e. using 'diff' to compare version1 with version1-customised, then apply diff output to version2 using unix's 'patch'. I wrote some perl script to adjust the line numbers of the 'diff' output, just so that 'patch' gets a better initial guess. Patch is pretty intelligent but the changes were pretty extensive, so I thought this would be safer.

After the diff/patch process, I had to go through the conflicts as per Jatar's post. For that I found a windows program called Araxis very useful. In fact if there aren't many files, Araxis could be used to do it all as it has a great gui interface. But in my case there were lots of files, so I was trying to automate as much as possible.

Another alternative I investigated which also looks good if you are a unix hack is an Open Source package called Arch (Search for something like Arch RCS)

So I used a mixture of windows and unix environments to solve this... If anyone knows of a good unix program similar to Araxis (with all the GUI niceties and without the pricetag of Clearcase) I'd be really interested.

Shawn