info-cvs
[Top][All Lists]
Advanced

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

Re: Merge Confusion


From: Sergei Organov
Subject: Re: Merge Confusion
Date: 30 Jun 2004 18:57:38 +0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

"work" <address@hidden> writes:
> Ok, Based on 2 emails from this list, the CVS manual, and the Essential CVS
> book, I'm confused about the whole merge what tag where stuff.  I hope I craft
> this email to get a clear answer to unfog my head. Project Name: testproj
> Local Sandbox is: rel_1/testproj while in local sandbox, issued cvs tag
> rel_1-before-branch
> 
> then issued cvs tag -r rel_1-before-branch -b rel_1
> then issued cvs tag rel_2_start Still in the rel_1/testproj sandbox I issue
> the the cvs update -r rel_1 command.  This now updates the rel_1/testproj
> sandbox to contain the branch. I then backup a couple of directories and
> create a new directory called rel_2 and issue the command cvs checkout
> testproj (this then creates a local sandbox rel_2/testproj that contains the
> trunk. Now, I make bug fixes to rel_1/testproj and want to merge these changes
> into rel_2/testproj.  The files in rel_1/testproj contain a mix of added,
> modified, and deleted lines.  At this point, I'm not overly concerned about
> deleted or added files (to me they are much easier to deal with since the
> entire file is involved). I go into the rel_1/testproj sandbox and issue the
> following commands: make sure i have the latest sources - cvs -q up -dP
> 
> tag the repository - cvs tag rel_1-20040630 I go into the rel_2/testproj
> sandbox and issue the following commands: make sure i have the latest srouces
> - cvs -q up -dP
> 
> tag the repository - cvs tag rel_2-20040630 Now I'm ready to merge.  Since I
> want to merge from the branch into the trunk, I'll be in the rel_2/testproj
> sandbox.  Which command do I issue?

Well, I didn't find a correct one in the list you've provided, so here is
how I would do it:

All you've made so far is OK, but I'd add one more tag that marks the
last revision on the branch you've merged up to so far. For now, set it
to the root of the branch as we didn't merge anything yet:

   $ cvs rtag -F rel_1-merge -r rel_1-before-branch  testproj

   (maybe rel_1-last-merge is even better name for the tag)

Then, the merge itself would be:

1. Tag current branch state with rel_1-tmp tag.

   $ cd ~/rel_1/testproj
   $ cvs update -d -P
   ... make sure you have no local changes ...
   $ cvs tag -F rel_1-tmp

2. Merge changes between rel_1-merge and rel_1-tmp into rel_2:

   $ cd ~/rel_2/testproj:
   $ cvs update -d -P
   ... make sure you have no local changes ...
   $ cvs update -d -P -j rel_1-merge -j rel_1-tmp

3. Resolve conflicts, commit changes back.

4. Move the rel_1-merge tag to the rel_1-tmp tag to record the point in
   the branch for the next merge:

   $ cvs rtag -F rel_1-merge -r rel_1-tmp testproj

That's it. Rather simple in fact.

Please note that all this business with rel_1-tmp tag is there to
prevent troubles when some other developer commits something on the
branch after you've invoked merge command but before you've moved the
rel_1-merge tag.

In your particular case, rel_1-tmp is the same as your rel_1-20040630,
so you can substitute the former by the latter in the last two commands
above. However, for me it seems easier to remember how to merge when
involved tags are always called the same for given branch. This way
every next merge of changes made on the rel_1 branch will look exactly
the same.

-- 
Sergei.





reply via email to

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