Nick Clifford <[EMAIL PROTECTED]> writes:
> I've been trying to work out a solution to this problem for awhile:
>
> We are working on this product that we received from a vendor (version
> 2.3), the product was good, but we made some changes. Now the vendor has
> finally released v 2.4, and we noticed 90% of our changes have been
> implemented.
>
> So what we want to do is import the vendors v2.4, and NOT merge our
> changes with it.
>
> There are a lot of files that have been added, deleted and changed. So
> we'd rather switch to the vendors 2.4, and add the few changes they
> didn't put it.
>
> So far in all my tests/experiments, the vendors changes are merged with
> ours, which causes massive ammounts of conflicts/etc.
>
> Does anyone know of an easy way to do this? (Other than starting a new
> repository and loosing all of our history).
Unless I misunderstand your problem, this should be pretty
straightforward. The general idea is to first revert your own
changes, then merge the vendor's new version.
Assume the module is called `aprod'; further, the import of
vendor source is on vendor branch `avendor' and the imports are
tagged `aprod_2-3' and `aprod_2-4'.
Also assume that your modified version is tagged as
`aprod_ourmods_2-3' and lives at the tip of the trunk[1], i.e. all the
latest file versions on the trunk are tagged `aprod_ourmods_2-3'.[2]
(Something like the following should work for CVS 1.10.8
client/server, but YMMV.)
Checkout a trunk-based workspace:
bash$ cvs co aprod && cd aprod
Back out the changes you applied to `aprod_2-3'. Generally, this
could be done using cvs diff and patch(1). In this case, however, it
seems easiest to just remove added files and dump the v2.3 sources
into the workspace. Then check for files that were removed wrt
aprod_2-3; these may need to be re-added. Finally commit:
bash$ ADDEDFILES=$(cvs diff -r aprod_2-3 2>&1 >/dev/null | grep 'tag .* is not in
file' | awk '{print $9}')
bash$ [ -n "$ADDEDFILES" ] && cvs rm -f $ADDEDFILES
bash$ (cd .. && cvs export -r aprod_2-3 -d aprod.tmp aprod)
bash$ (cd ../aprod.tmp && cp -pR . ../aprod)
bash$ cvs -nq up | grep ^\? # (a)
bash$ cvs add ... # (b)
bash$ cvs -q diff -r aprod_2-3 > /dev/null
bash$ cvs ci -m "Back out all of our modifications to aprod_2-3."
NOTE: the stmts labeled (a) and (b) may need to be repeated.
Then pull in the changes from v2.3 to v2.4:
bash$ cvs up -j aprod_2-3 -j aprod_2-4
bash$ cvs -q diff -r aprod_2-4
bash$ cvs ci -m "Merge from vendor branch: avendor/aprod_2-4."
> ps. Oh and if anyone is interested, we modified CVS to use PAM for
> authentication instead of the /etc/passwd file. The patch is rough, but
> it works. If anyone wants it, let me know.
I'm interested. Perhaps you'd like to post the patch to the list as
well?
Footnotes:
[1] The trunk being pretty much mandatory as development code
line if one uses vendor branches.
[2] Optionally, open a maintenance code line for your modified
v2.3:
bash$ cvs rtag -b -r aprod_ourmods_2-3 aprod_ourmods_2-3_maint aprod
--
Michael Diers