info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: merged code from branch to MAIN


From: Guus Leeuw jr.
Subject: RE: merged code from branch to MAIN
Date: Tue, 9 Nov 2004 20:28:43 +0100

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On Behalf 
> Of Rick Oosterholt
> Sent: dinsdag 9 november 2004 11:26
> 
> branch visualisation:
> 
>     /----- branch B -------
>    /
> --/-------- MAIN trunk ----
> 
> Our MAIN branch was very old, only development on branch B 
> was performed.
> We wanted code from branch B to overwrite code in MAIN.
> This was causing very many merge conflicts. So we copied 
> files from a branch B checkout to a MAIN checkout and 
> commited the code.

Aua

> Now, each time when we try to merge code from branch B to the 
> MAIN trunk, *ALL* files are flagged to be modified and many 
> files give merge conflicts.

As Cederqvist put it: "can have undesirable side effects"...

> How do we solve this problem? How can be do a branch merge 
> again and only modified files get merged?

Either:
* You happen to have a backup of the Repo before you did the hack?
Re-install it, but only if you also have a copy of the checked out and
possibly changed branch... ;)

OR

* No backup? OK... For every file in the checked out unmodified HEAD, grab
the current revision, go two revisions back, (if 1.5 is current, than 1.4 is
the copy, and 1.3 is the last known good...):
cvs upd -j 1.5 -j 1.3 <file>
cvs ci

At this stage, you have a clean repository again...

Now just go to the branch checked out version, cvs -nq upd and if needed cvs
ci. Branch is OK now as well. Go to the checked out and up to date sandbox
of HEAD. cvs upd -j <branchname>, resolve the conflicts, and cvs ci... Then
go to the branch sandbox and cvs tag -f branch_merge_tag (use a decent
name!)

Next time around, when you merge changes from the branch into the TRUNK, use
the branch_merge_tag you created above.

The conflict section is kinda hard, but then again, if you resolve them
proper, you're fine. For ever ;) And there might be some tools that could
help you resolve the conflicts... Or write a quick perl that greps for >>>>
====, and <<<< in every source file... Display the differences, ask which
one to keep, and write all that proper code back to the file.

Success,
Guus

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.784 / Virus Database: 530 - Release Date: 27/10/2004
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]